How to upgrade npm to latest from v5.4.1 after I have installed Nodejs v9.0.0

Viewed 1486

status: It seems that NodeJS have an issue which is still not resolved:

OS:Windows

On my machine I started with NodeJS v.7.5.0 and npm v.5.4.2.

Downloaded and installed Nodejs v.9.0.0, but npm did upgrade to npm v5.5.1

When tried to upgrade my npm with npm install npm@latest -g the following error traceback appeared:

npm WARN npm npm does not support Node.js v9.0.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8.
npm WARN npm You can find the latest version at https://nodejs.org/
C:\Program Files\nodejs\node.exe: src\node_zlib.cc:430: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.

Any suggestion how to fix it?

3 Answers

Remove both installations and install nvm. (or nvm-windows)

Then, you just run:

nvm install 7.5.0

And:

nvm install 9

This will install each nodejs version with its corresponding npm version.

Try this:

  • Uninstall node
  • Delete %AppData%\npm
  • Delete %AppData%\npm-cache
  • Install Node 9.0.0
Related