npm WARN: npm does not support Node.js v12.4.0
Solution 1
Seems like you messed up with permissions in /usr/local
.
Here is how to fix that:
-
Fix
/usr/local
permissions:sudo chown -R `id -un`:`id -gn` /usr/local
-
Clean
npm
cache and uninstall it:npm cache clean -f npm -g uninstall npm
-
Reinstall
node
(withnpm
)brew reinstall node
-
Upgrade
npm
:npm -g i npm
That should bring [email protected]
.
You should avoid using sudo
while installing software with brew
or npm
, that could cause issues like this.
Solution 2
What worked for me:
if you try running this command "npm cache clean -f" and it doesn't work,
on your windows machine(mine is windows 10) access the "npm" and "npm-cache" folders in this location "~\AppData\Roaming\"
delete these two folders "npm" and "npm-cache".
go to your windows search bar and search for Node, right click to open file location, run the uninstaller to uninstall NodeJs.
then visit nodejs.org and download and install node again, if you've already downloaded it, visit the folder where you downloaded it to reinstall it.
after installation, check your version of npm by typing "npm -v" on your command terminal to see the new updated version of npm installed on your machine.
now you're all set, Happy coding.
Solution 3
Had the same issue with Debian 10 (buster) when I tried installing the npm and node.js. They were incompatible and wouldn't update. This was what I found works for me.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
The nodejs package was installed at a different path and I manually deleted the old package (in /usr/bin/
) and added a symlink to point to the new one (in /usr/local/bin
).
sudo rm /usr/bin/node
sudo ln -s /usr/local/node /usr/bin/node
This is the initial printouts from running the commands. The npm
version updates from 5.8.0
to 8.1.2
. But the nodejs
version stayed at 10.24.0
even after reboot with hash -r
.
Solution 4
None of the answers here worked. I had to delete the npm and npm-cache folders, then reinstall npm. Details here: npm does not support Node.js v12.18.3
Solution 5
If you have nvm
you may have an issue in which your node version installed at a certain version didn't match.
For example, I accidentally used: npm i -g node --force
resulting in my nvm v12.21.0
to point to v16.5.0
(the latest version of node at that time directly downloadable).
To solve: I ran:
- Just for good measure
brew uninstall nvm
-
brew install nvm
. nvm uninstall 12.21
nvm install 12.21
- Just for good measure I ran
npm i -g npm
resulting in the latest version ofnpm
installed on that virtual node. - After installing within some repo (using
npm i
) you may also want to check your:~/.npmrc
.
[email protected]
registry=https://artifactory.company.com/npm/npm/
always-auth=true
user-agent=npm/6.14.11 node/v12.21.0 darwin x64
_authToken=siofjwoirgiowrgnioaenrvoianeoiio32noi23nio23nio23nio
It should look something like this: (or you might not have any of that.
Related videos on Youtube
Can Poyrazoğlu
Has most experience in iOS programming and UI design. Loves astrophotography, board sports, feeding street animals, authoring his humble blog, and flying drones.
Updated on July 09, 2022Comments
-
Can Poyrazoğlu almost 2 years
I've been getting the following warnings lately whenever I run any npm script:
npm WARN npm npm does not support Node.js v12.4.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 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/
It says that I should upgrade to a newer version, but v12.4 is the newest version. Even though the scripts run fine, I think there's no guarantee and something might break at any moment.
I've also tried updating
npm
in case there's a newer version usingnpm install npm -g
but got the error:npm ERR! path /usr/local/Cellar/node/12.4.0/lib/node_modules/npm npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/Cellar/node/12.4.0/lib/node_modules/npm' npm ERR! [Error: EACCES: permission denied, access '/usr/local/Cellar/node/12.4.0/lib/node_modules/npm'] { npm ERR! stack: 'Error: EACCES: permission denied, access ' + npm ERR! "'/usr/local/Cellar/node/12.4.0/lib/node_modules/npm'", npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/Cellar/node/12.4.0/lib/node_modules/npm' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It is likely you do not have the permissions to access this file as the current user npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended).
Then I've seen that Homebrew version of
npm
can't be updated using npm itself, so I tried updating throughHomebrew
usingbrew upgrade npm
but got this error:Error: npm 12.4.0 already installed
For some reason Brew mixes up
node
s andnpm
s versions.What am I doing wrong and how can I get rid of this warning?
-
Thanh Nguyen Van almost 5 yearstry to
sudo npm install -g npm@latest
-
Styx almost 5 yearsWhat
which npm
shows? -
Can Poyrazoğlu almost 5 years@Styx
/usr/local/bin/npm
-
Styx almost 5 yearsWhat about
npm -g ls --depth=0
andls -la /usr/local/bin/npm
?
-
-
Can Poyrazoğlu almost 5 yearsI tried it, it claimed to install
[email protected]
, butnpm -v
still outputs 6.4.1. -
Can Poyrazoğlu almost 5 yearsYup, that did it. Thanks! I'll be more careful with
sudo
using package managers though :) -
Matt R about 4 yearsThese instructions work. However, instead of uninstalling, selecting "Repair" instead of "Uninstall" will also work.
-
Code Tree over 2 yearsafter a long battle this is the only thing worked..I am on ubuntu + nvm