Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm WARN: npm does not support Node.js v12.4.0

Tags:

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 using npm 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 through Homebrew using brew upgrade npm but got this error:

Error: npm 12.4.0 already installed

For some reason Brew mixes up nodes and npms versions.

What am I doing wrong and how can I get rid of this warning?

like image 613
Can Poyrazoğlu Avatar asked Jun 28 '19 10:06

Can Poyrazoğlu


People also ask

What version of NPM is node 12?

13.0 (LTS) | Node. js.

What version of node does NPM support?

The npm CLI supports running on any version of Node. js currently supported by the Node. js Foundation. That is, we support the most recent version (even if that's not an LTS release) and we support any version still in maintenance.


1 Answers

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.

like image 135
Chidi-Nwaneto Avatar answered Dec 21 '22 23:12

Chidi-Nwaneto