无法使用npm install -g react-native-cli进行安装

时间:2017-10-15 11:33:54

标签: react-native npm npm-install react-native-cli

尝试使用

安装react-native-cli
npm install -g react-native-cli

导致此错误:

npm ERR! Darwin 16.7.0
npm ERR! argv "/Users/kamleshtilwani/.nvm/versions/node/v8.6.0/bin/node" "/Users/kamleshtilwani/.nvm/versions/node/v8.6.0/bin/npm" "install" "-g" "react-native-cli"
npm ERR! node v8.6.0
npm ERR! npm  v3.4.1
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'internal/errors'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kamleshtilwani/npm-debug.log

NPM install error

1 个答案:

答案 0 :(得分:0)

对我的Mac进行快速测试表明,更新npm将为您提供帮助。

this question(也在Mac上)的接受答案似乎也表明,碰撞npm版本(在这种情况下为5.4.2)将消除此错误。

我可以使用npm 5.0.0在我的Mac上安装react-native-cli。我降级到npm 3.4.1,尝试再次安装,并得到类似于你的错误,尽管我的咆哮是internal/fs而不是internal/errors

祝你好运!