使用 npm start启动npm,提示错误:
> leclient@1.0.0 start /Users/nigellee/Documents/LeMobileClient-ReactNative
> node node_modules/react-native/local-cli/cli.js start
module.js:472
throw err;
^
Error: Cannot find module '/Users/nigellee/Documents/LeMobileClient-ReactNative/node_modules/react-native/local-cli/cli.js'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:425:7)
at startup (bootstrap_node.js:146:9)
at bootstrap_node.js:540:3
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! leclient@1.0.0 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leclient@1.0.0 start script 'node node_modules/react-native/local-cli/cli.js start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the leclient package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/react-native/local-cli/cli.js start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs leclient
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls leclient
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! /Users/nigellee/Documents/LeMobileClient-ReactNative/npm-debug.log
解决办法:npm install重新安装以后,配置:
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
即可