简体   繁体   English

安装npm时出错

[英]Getting error while installing npm

I have installed node through brew install node , Node has been installed but after running: 我已经通过brew install node ,已经安装了Node,但是在运行之后:

npm install -g create-react-native-app

npm is showing the following error: npm显示以下错误:

module.js:487

   throw err;
   ^

Error: Cannot find module '../lib/utils/unsupported.js'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)

Try installing yarn. 尝试安装纱线。

brew install yarn

yarn global add npm

npm --version

Hope that works. 希望能奏效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM