npm i 又出错了,又 Google,算了,还是记一下解决方法吧。。。

Bash History

➜  test-001 npm i
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/util/types'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zhoukeke/.npm/_logs/2018-03-26T07_49_53_692Z-debug.log
➜  test-001 sudo n
node/6.11.3
➜  test-001
➜  test-001
➜  test-001
➜  test-001 sudo npm install npm -g
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
- fstream@1.0.10 node_modules/npm/node_modules/fstream
...
➜  test-001 sudo n stable
➜  test-001 npm i
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN test-001@0.1.0 No repository field.
npm WARN test-001@0.1.0 No license field.

added 48 packages in 2.524s

References

  • https://blog.csdn.net/m1213642578/article/details/79085782
  • https://stackoverflow.com/questions/40308623/cannot-find-module-internal-fs-after-upgrading-to-node-7/40406482#40406482