我已经通过brew install node
安装了节点,Node已经安装但是在运行之后:
npm install -g create-react-native-app
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)
答案 0 :(得分:2)
尝试安装纱线。
brew install yarn
yarn global add npm
npm --version
希望有效。