On a MacBook with the latest version of NodeJS, I am trying to update npm:
npm install npm@latest
The error message is:
npm ERR
Try to reinstall npm from the package in node v6.11.3LTS, and then
try to update to the latest npm v5.4.2
npm install npm@latest -g
and then update to the latest node v8.3.0
npm install node@latest -g
I had the same problem, and I solve it:
uninstall node and npm, do as this answer.
then install node
brew install node
and npm will also be installed.
I had the same issue, the above answer did not work.
I had old versions in node_modules.
I simply deleted everything in node_modules and then ran:
npm install npm@latest -g