npm damaged, are-we-there-yet npm is a packet depends npmlog dependent npm can reinstall:
➜ lib asl 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)
Solution:
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
6.13.7-npm .tgz is the version I used, you can also check the version number in the corresponding official website.
https://www.npmjs.com/package/npm
reference: