无法用npm(反应)安装任何东西

时间:2016-11-16 13:26:28

标签: node.js reactjs npm

我已经为我的第一个反应项目克隆了Hot Reload Boilerplate(https://github.com/gaearon/react-hot-boilerplate)。

前几天可以使用npm install --save react-router安装React Router。但是现在我想安装像Axios这样的依赖项来使用JSON(https://github.com/mzabriskie/axios)或者来自https://facebook.github.io/react/docs/animation.html的这个ReactCSSTransitionGroup来获取数据,但是当我运行npm install axios时,我会保留这些错误:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "axios"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@0.14.8 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-dom@0.14.8 wants react@^0.14.8
npm ERR! peerinvalid Peer react-router@3.0.0 wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer react-addons-css-transition-group@15.3.2 wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

当我运行像npm i之类的东西时,我也会遇到这些错误:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package react@0.14.8 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer react-dom@0.14.8 wants react@^0.14.8
npm ERR! peerinvalid Peer react-router@3.0.0 wants react@^0.14.0 || ^15.0.0
npm ERR! peerinvalid Peer react-addons-css-transition-group@15.3.2 wants react@^15.3.2

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ludo/Documents/sites/react/FirstApp/npm-debug.log

这是什么意思,我该如何解决这个问题?

谢谢!

2 个答案:

答案 0 :(得分:1)

您使用旧版npm(2.15.9)。运行它来更新它......

$ npm install -g npm

然后再次尝试安装依赖项。

答案 1 :(得分:-2)

如果您启用了自动保存,请尝试取消选中它。