Cannot find module 'npmlog'

最近尝试react native开发,安装react-native时报错。

terminal下键入 npm install -g react-native-cli 尝试安装react native命令行时报错:

module.js:328     throw err;     
^ Error: Cannot find module 'npmlog'  
at Function.Module._resolveFilename (module.js:326:15) 
at Function.Module._load (module.js:277:25)     
at Module.require (module.js:354:17)     
at require (internal/module.js:12:17)     
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:20:13   
at Object. 
(/usr/local/lib/node_modules/npm/bin/npm-cli.js:76:3)     
at Module._compile (module.js:398:26)     
at Object.Module._extensions..js (module.js:405:10)     
at Module.load (module.js:344:32)     
at Function.Module._load (module.js:301:12)

解决:重新安装npm

curl -0 -L http://npmjs.org/install.sh | sudo sh

 

Author

Ludis

Posted on

2016-02-13

Updated on

2016-07-30

Licensed under

Comments