2015-10-07 18 views
5

react-routerをインストールしようとしていますが、次のエラーが表示されます。react-router peerDependenciesエラー

$ npm install react-router 
npm WARN peerDependencies The peer dependency [email protected] included from react-router will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-router" 
npm ERR! node v0.12.7 
npm ERR! npm v2.11.3 
npm ERR! code EPEERINVALID 

npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements! 
npm ERR! peerinvalid Peer [email protected] wants [email protected]^0.14.0-rc1 
npm ERR! peerinvalid Peer [email protected] wants [email protected] 
npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.13 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\ReactApps\good start\npm-debug.log 

私が使用reactnode-modulesでのショーのためのpackage.json:私は、以前のバージョンを

"version": "0.14.0-rc1", 

をインストールする必要がありますか? 0.13.xはより良いサポートされたバージョンかもしれないようですか?

この場合、現在のプロジェクトを台無しにすることなくインストールするにはどうすればよいですか?


npm install npm -g 

を使用した後、私はnpm -vを入力し、私のプロジェクトでのバージョンは2.11.13はまだであることを見ました。 私はそれがNPMのローカルバージョンので、私は、入力されたかもしれないと考え出し:ローカルで更新された最新バージョンを得ることを望ん

npm install npm 

、それでも私は、バージョンをチェックするとき2.11.13を得ました。

comp-asus XXX64 /c/ReactApps/goodRouter/goodrouter (master) 
$ npm -v 
2.11.3 

comp-asus XXX64 /c/ReactApps/goodRouter/goodrouter (master) 
$ npm install react-router 
npm WARN peerDependencies The peer dependency [email protected] included from react-router will no 
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-router" 
npm ERR! node v0.12.7 
npm ERR! npm v2.11.3 
npm ERR! code EPEERINVALID 

npm ERR! peerinvalid The package react does not satisfy its siblings' peerDependencies requirements! 
npm ERR! peerinvalid Peer [email protected] wants [email protected] 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\ReactApps\goodRouter\goodrouter\npm-debug.log 

グローバルチェックするとき、私はそれが更新されたことがわかります。

$ npm list -g --depth=0 
C:\Users\Roger\AppData\Roaming\npm 

    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] invalid 
    ├── [email protected] 
    └── [email protected] 

しかし、どのように私は、プロジェクト内のグローバルバージョンを使用していますか?

それでも問題は解決しますが、私は正しい軌道に乗っていると思います。


$ where npm 
C:\Program Files\nodejs\npm 
C:\Program Files\nodejs\npm.cmd 
C:\Users\Roger\AppData\Roaming\npm\npm 
C:\Users\Roger\AppData\Roaming\npm\npm.cmd 

だから私は、これらのいずれかを削除する必要がありますか?

答えて

18

これは[email protected]で解決された主要な問題の1つです。詳細は、https://github.com/npm/npm/issues/6565を参照してください。 npmを更新

は行うには正しいことである:

$ npm install npm -g 
+0

ありがとうございました!可能であれば、更新をご覧ください。私は+1するのに十分な担当者がいないが、私はあなたに感謝する。 – RogerDore

+0

@RogerDore 'nvm'のようなノードのバージョンを管理するツールを使用していますか? – eush77

+0

ノードのバージョンを管理するためのツールに慣れていません。私は今、nvmを探します。 – RogerDore

関連する問題