npm Error: Cannot find module 'are-we-there-yet'
npm 损坏了,are-we-there-yet是npm所依赖的npmlog依赖的一个包,重新安装npm即可:
➜ lib npm module.js:550 throw err; ^ Error: Cannot find module 'are-we-there-yet' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:2:16) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3)
解决办法:
cd /usr/local/lib/node_modules mv npm /tmp sudo curl -L registry.npmjs.com/npm/-/npm-6.13.7.tgz |sudo tar xz --transform="s:^package:npm:" ➜ ~ npm -v 6.13.7
npm-6.13.7.tgz 是我使用的版本,你也可以在官网查询相应的版本号。
https://www.npmjs.com/package/npm
参考: