125

I updated to the latest node v9.1.0 and now npm doesn't work.

npm WARN npm npm does not support Node.js v9.1.0

Matt
  • 33,328
  • 25
  • 83
  • 97
  • 2
    It looks like this is an npm problem (https://github.com/nodejs/node/issues/16649); there's a workaround here: https://github.com/npm/npm/issues/19019#issuecomment-340940842 – Chris Forrence Nov 10 '17 at 15:35

25 Answers25

123

It turns out that the current installed npm is not compatible with the new node and has a hard time updating.

The solution is to uninstall npm and then reinstall node which will contain the correct version of npm.

Here's how:

  1. Uninstall npm.

    Mac:
    sudo npm uninstall -g npm
    
    Windows:
    npm uninstall -g npm
    
  2. Install node from https://nodejs.org

Matt
  • 33,328
  • 25
  • 83
  • 97
  • 4
    I was getting errors with the above command. Running `which npm` gave me the location of an npm symlink (`/usr/local/bin/npm`), which I followed to the actual installation and manually deleted. Now `which npm` gives me the non-erroring nvm npm version. – RobW Nov 20 '17 at 21:22
  • after uninstall, the following command needs to be executed: npm i -g npm@next – Yogamurthy Dec 22 '19 at 15:08
  • 3
    Trying to make npm uninstall itself because it's broken gave me the same error `npm does not support Node.js vx.x.x` and crashed before doing anything. @RobW's solution worked, I did `sudo rm -rf /usr/local/bin/npm` and it fell back to NVM's version, which is the correct one. – Jeremy Thille Dec 10 '21 at 08:50
  • 7
    Yeah but you can't uninstall npm with npm as npm is not usable. – Silidrone Apr 03 '22 at 09:22
  • installing node is not giving me npm :( – skittlebiz Jan 16 '23 at 22:43
41

Uninstall the global instance of npm:

npm uninstall -g npm

This will cause your system to fall back on the version of npm installed by node 9.1.0 and the warning will disappear.

Ilyich
  • 4,966
  • 3
  • 39
  • 27
  • 3
    Following the advice to uninstall a global instance of npm has resolved the issue for me, using: npm uninstall -g npm This caused my system to fall back on the version of npm installed by node 9.1.0, thereby resolving the warning. – Nitin Jan 14 '19 at 13:31
  • 2
    it prints the same error again – Mahmoud Mabrok Mar 08 '23 at 12:31
36

What worked for me was to delete npm and npm cache from C:\Users\chrisd\AppData\Roaming

Then I ran npm i -g npm@next for the latest version of npm for Node 9.x

NPMJS.org has issued a new release 11.27.2017 -- npm v5.6.0

(You may not have to delete the npm/npm cacheif you just upgrade, but I had already done that before finding the new release)

NPMJS Release notes

Chris22
  • 1,973
  • 8
  • 37
  • 55
  • 1
    this helped to update to 5.6.0 after installing node v9.3.0 – blfuentes Dec 13 '17 at 07:28
  • 3
    I had to delete `npm` and `npm cache` from `%appdata%` before reinstalling from https://nodejs.org/en/download/. This was the only thing that worked. – LStarky Nov 21 '19 at 14:35
  • 1
    I deleted the 2 folders in %appdata% and then running npm showed a higher version number - 6.14.6 (from node upgrade) instead of 5.10.0. I then ran npm install -g npm-windows-upgrade followed by npm-windows-upgrade which allowed me to select the version I wanted (6.14.7). – GarDavis Aug 10 '20 at 15:55
  • 3
    This worked for me. `npm uninstall -g npm` didn't because off course, it didn't work with my node version. – Scuba Kay Dec 04 '20 at 17:14
  • 3
    Thank you. So sick of getting told to run `npm` commands to fix a broken `npm`. – baynezy Jul 19 '21 at 13:56
  • yes just deleted the npm directory only. and re-installed the nodejs download selecting the repair option. npm commands worked after that. – john blair Jan 13 '22 at 15:45
34

Fixed my issue update to 5.71

npm uninstall -g npm

npm i -g npm@next
Dan Atkinson
  • 11,391
  • 14
  • 81
  • 114
tomtom
  • 341
  • 3
  • 4
  • 1
    thanks it looks like a clean uninstall and install it works for me. – zero8 Feb 11 '19 at 10:28
  • 3
    Except `npm uninstall` removes npm making the next command `npm i` fail. At least that is the situation on Linux. – Marc Jun 22 '20 at 16:38
23

Had similar issue in linux/ubuntu, below helped solving it.

  1. Remove existing versions of npm and node:

    sudo apt --auto-remove purge npm
    sudo apt --auto-remove purge nodejs
    
  2. Re-install node

Alex M
  • 2,410
  • 1
  • 24
  • 37
  • 2
    This works to me. After remove NPM and NODE by your command, i also run `npm uninstall -g npm ` because there was a other version on my local user. after remove all what i have found: `npm -v`and `node -v` return "... not found". so i can keep on install all from the the scratch. – michael-mammut Dec 05 '21 at 15:28
9

for me worked

npm uninstall -g npm

npm i -g npm@next

No need for manual installation or clearing the cache. Run with admin credentials if needed.

Sasha Firsov
  • 699
  • 8
  • 9
7

I saw this warning after I upgraded to Node 10.4.1 after that I just ran npm uninstall -g npm with -g flag to remove it globally and the error was gone. I guess it updated my npm to version 6.1.0 enter image description here

Mirza Sisic
  • 2,401
  • 4
  • 24
  • 38
  • 1
    OMG this worked. I installed node.js v10.15.0, then my npm 5.4.2 was trippin like that. Incredible. After "unistalling", now I have 6.4.1 npm... who understands this? – Csaba Toth Feb 01 '19 at 02:38
  • I'm not really sure, but it has something to do with different npm versions in node, there seems to be some exotic compatibility issues. – Mirza Sisic Feb 02 '19 at 15:46
  • 1
    I wonder if this is a case of ambiguity / overloading. In my Windows environment I ended up having Cygwin, MINGW, MySISGit, and also the Windows Subsystem for Linux. I updated the Node.js with the Node.js native windows x64 installer, and that supposed to upgrade npm as well but that somehow got shadowed (?) by an older one somewhere. When we remove the older one it gives way to the installed newer one (?). These are just suspicions. – Csaba Toth Feb 02 '19 at 19:04
7

Solution :

  1. Go to the path where you can find the debug log (this file is found in your npm-cache folder) C:\Users\yourname\AppData\Roaming
  2. Delete the NPM and NPM-Cache folder, but DO NOT reinstall node. Once deleted go back to your command line and re-use the command " npm install -g npm@latest "
Hrits
  • 83
  • 2
  • 6
5

If you are unable to uninstall npm, instead you can skip that step and just

Reinstall npm https://nodejs.org/en/

kris
  • 11,868
  • 9
  • 88
  • 110
5

What worked for me - On Ubuntu

Install nodejs

sudo apt install nodejs

Install npm

curl -L https://www.npmjs.com/install.sh | sudo sh

umesh kadam
  • 1,163
  • 11
  • 16
4

This error occurs when the npm version not compatible with the node version. However npm uninstall -g npm also gives the same error for me.

So following steps work for me.

Option 1:

Step1: Follow this directory

C:\Users(your username)\AppData\Roaming

Step2: Delete the npm folder. And if there is a folder called `npm cache, delete it also.

Step3: Run npm clean cache —force ( — force is now required to clean cache)

If the above option is not worked for you please follow the below steps.

Option 2:

Follow this directory

C:\Users(your username)\AppData\Roaming

Delete the npm folder and if there is one mom cache folder.

Run npm clean cache --force ( -- force is now required to clean cache)

Make sure everything to do with Nodejs is deleted and uninstalled.

Reinstall Nodejs.

4

I had the same issue with npm when I have updated Node js on windows. I tried many things but only working solution was :

First uninstall npm with below command

npm uninstall -g npm

Now Install latest version

npm install npm@latest -g
Muzzamil
  • 2,823
  • 2
  • 11
  • 23
3

If you are using Mac and brew, that's how I've got rid of this problem:

Even though I installed and reinstalled node with brew, with last version 11.8.0, apparently it kept using the last version

fdecollibus$ npm install --global gatsby-cli
npm WARN npm npm does not support Node.js v11.8.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, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/Cellar/node/11.8.0/bin/gatsby -> /usr/local/Cellar/node/11.8.0/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli@2.4.8

npm -v gave me back version 5.6.0. I've therefore noticed that /usr/local/lib/node_modules had wrong permissions assigned to root:wheel.

A chown did not fix the problem: I've had to manually delete the content of the folder (cd /usr/local/lib/node_modules and -careful - type rm -rf * ) to get rid of the folder.

Then I've run brew uninstall node and again brew install node, and finally npm -v gave me back 6.5.0

Gryu
  • 2,102
  • 2
  • 16
  • 29
3

Executing npm uninstall -g npm gave me same error enter image description here

  • Uninstall Node.js installed in the system
  • Goto c:\Program File\nodejs (default location of the nodejs installation). Remove all contents of the folder manually.
  • Remove npm, npm-cache folder from Roaming folder under your username.
  • Install Node.js again.

running npm install @angular/cli -g worked for me.

3

Navigate to the Appdata by typing %AppData% in the run or search.

enter image description here

Delete the npm and npm-cache folder and then install the nodejs again. It solved the issue for me.

Karthikeyan VK
  • 5,310
  • 3
  • 37
  • 50
2

I was getting the below warning when I executed, npm install to install package.json for my angular project.

npm WARN npm npm does not support Node.js v9.1.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/ WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.ng-080b84bf08dd68e5.lock for ...\Angular\node Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above. C:\Program Files\nodejs\node.exe: src\node_zlib.cc:437: Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed.

According to @Ilyich, I uninstalled global npm, npm uninstall -g npm And then I executed npm install to install my package, it installed successfully.

Sunita
  • 258
  • 1
  • 5
  • 10
1

If you are getting the same warnings while creating or importing an Angular project in an IDE such as Eclipse ,do the following:

File->New->Angular In the window that appears change the versions of Nodejs and NPM to "use system installation"

... If the process crashes at "installing packages for tooling via npm"

Close the terminal in IDE and manually go to the project directory and do "npm install".

Refresh the project in IDE

Amal Vijayan
  • 649
  • 2
  • 6
  • 26
1

I had a similar issue trying to install other stuffs. And looks like the npm version was not compatible with my node version. In my case i had npm 5.4.2 and node v10.15.0 At the end of this process i had the version npm 6.7.0 and node v10.5.0

First Option: I downgrade the version of node and other tools.

On terminal execute the next command with the version to be installed. (Example if we need change to node 8.14.1)

1.- Npm install -g node@8.14.1

Then we execute the command to uninstall the version to be removed.

2.- Npm uninstall -g node@8.15.0

After that we need execute the next command to set the new path

3.- Npm update -g node@8.14.1

Finally we only need execute the version to see if the changes were added successfully

4.- Node -v

In this case we will see the version as 8.14.1 and we finished the process. If you want do it for Appium and Npm version you can open a new terminal and follow the same steps in order to change the version. For example:

Npm install -g appium@1.7.2
Npm uninstall -g appium@1.10.0
Npm update -g appium@1.7.2
Appium -v

In my case you must have the next versions:

Node 8.14.1
Npm 6.4.1

Other Way: To solve it i just execute in the terminal the next line.

curl -L https://npmjs.org/install.sh | sh

After download a few files (took around of 10 minutes to see results in the terminal) i was able to continue working with the new latest and compatible version of both tools.

The next WARM was displayed in this case.

npm WARN npm npm does not support Node.js v10.15.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/
/Users
nircraft
  • 8,242
  • 5
  • 30
  • 46
  • Your help using curl does not work now for the installed npm. probably because of npm version its not applicable for all. – zero8 Feb 11 '19 at 10:28
  • I edited the post, check if you change the version works for you, 1.- Npm install -g node@8.14.1 Then we execute the command to uninstall the version to be removed. 2.- Npm uninstall -g node@8.15.0 After that we need execute the next command to set the new path 3.- Npm update -g node@8.14.1 Finally we only need execute the version to see if the changes were added successfully 4.- Node -v – Raknarrok Prototype Feb 14 '19 at 16:48
  • why is this answer downvoted? I followed this and was able to downgrade my node to 8.14.1 and the npm no longer show error. thanks – GeneCode May 04 '19 at 04:49
1

I am on a macOS and what ended up working for me was uninstalling npm, relinking Node, and reinstalling Node through Homebrew. (Prereqs: Have Homebrew installed and have a very confusing setup where npm and Node don't work together)

1. To uninstall homebrew: If you are on a Mac, you probably don't see the AppData\Roamingfolder; you should instead go to npm root -g and delete the npm_modules folder. Now, when you type npm --version your computer should be confused.
2. Reinstalling node: Try doing brew install node and if you already have node installed, your computer will ask you to reinstall it. If you do brew reinstall node and your versions of brew and npm look good, then you don't need to do the last step!
3. If you need to link the correct version of Node: This step was something I think was my fault since I think I had installed Node through Homebrew as well as the actual online download. Follow the suggestions after brew link node which should take you to brew link --overwrite node. There will be around 7 directories that the command will not be able to overwrite, which you should all delete using sudo rm -rf directory_name. (Do use your common sense, don't delete something important.) After you are finally able to run the brew link --overwrite node command without any errors, you should then do brew reinstall node since you don't have npm anymore.

Tada! You hopefully now have version of npm and node that hopefully can work together.

Alaska
  • 341
  • 2
  • 9
1

Just install latest version of Node.js from https://nodejs.org This will automatically update npm for you

0

Easiest way I found was to install the latest node with brew and the latest npm manually:

brew uninstall node
brew install node
npm install -g npm@latest

This removed the warning message. For some reason brew wasn't linking the new npm installed by node while it was updating node itself.

0

The easiest way(for windows) is to use the installer to remove node, then use it to reinstall node, at which time it will install the correct version of npm. running the above uninstall commands does not work, since the wrong version of node is installed, otherwise you wouldn't have this issue.

0

You can uninstall node current version, and install a early version that support npm. Then run npm install npm@latest -g and install current node version. It's work for me

0

lowering the npm version worked for me (windows 10):

npm i npm@6.14.11

KawaiKx
  • 9,558
  • 19
  • 72
  • 111
0

To upgrade the npm and Node:

Step 1. Uninstall the npm:

Mac: `sudo npm uninstall -g npm`

Windows: `npm uninstall -g npm`

Step 2: Install the latest version of Node: https://nodejs.org/en/

Yash Chauhan
  • 174
  • 13