module.js:341
throw err;
^
Error: Cannot find module 'npmlog'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:20:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:76:3)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
因为之前卸载node没有卸载干净,解决方法:brew uninstall --force node
rm -rf /usr/local/lib/node_modules
rm /usr/local/bin/npm
brew install node
https://stackoverflow.com/a/39504056/5685754
没有评论:
发表评论