【问题标题】:Can't install using npm install -g react-native-cli无法使用 npm install -g react-native-cli 安装
【发布时间】:2017-10-15 11:33:53
【问题描述】:

尝试安装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

【问题讨论】:

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


    【解决方案1】:

    在我的 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

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-13
      • 1970-01-01
      相关资源
      最近更新 更多