Copyright notice: This article is originally published BY the blogger. It follows the COPYRIGHT agreement CC 4.0 BY-SA. Please attach the link of the original source and this statement. This paper links: blog.csdn.net/m1213642578… NPM install failed to install NPM install

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/admin/.npm/_logs/2018-01-17T06_43_36_851Z-debug.log
Copy the code

After trying various methods, I got the answer. Before, I directly upgraded Node several times for the needs of the project, but NPM did not reinstall the upgrade.

The solution

You will need to degrade Node and reinstall NPM (if you have installed the N module before).

sudo n 6

sudo npm install npm -g

sudo n stable
Copy the code

Problem solved.