正在尝试使用安装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

发布于 2017-10-16 03:48:06
在我的苹果机上快速测试表明,更新npm可以帮你解决这个问题。
对this question (也在Mac上)的公认答案似乎也表明,升级npm版本(在本例中为5.4.2 )将消除此错误。
我可以使用npm 5.0.0在我的Mac上安装react-native-cli。我降级到npm 3.4.1,尝试重新安装,得到一个类似于你的错误,尽管我的错误是关于internal/fs而不是internal/errors。
祝好运!
https://stackoverflow.com/questions/46754564
复制相似问题