Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade npm to support Node.js v14.0.0 on MacOS?

Tags:

node.js

npm

I've recently installed newest version of node 14.0.0 on my computer (macOS Catalina). Wanted to start new project with. Initially I wanted to install express with npm install --save express and got below warning logs:

npm WARN npm npm does not support Node.js v14.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 6, 8, 9, 10, 11, 12, 13.
npm WARN npm You can find the latest version at https://nodejs.org/
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.

I am wondering if this is issue on my setup side and I should reinstall node (possibly downgrade?) or something different.

Thank you for you patience and support!

like image 942
tzach Avatar asked Apr 27 '20 19:04

tzach


3 Answers

Try :

Mac:
sudo npm uninstall -g npm // uninstalls globally 

Windows:
npm uninstall -g npm // uninstalls globally 

Then:

Re-install node

NOTE: Ensure that your PATH points to where node is installed e.g. If node installed at /usr/local/bin/node, ensure /usr/local/bin is in your PATH

like image 139
bgmn Avatar answered Sep 22 '22 10:09

bgmn


For windows. Follow this instructions here https://github.com/coreybutler/nvm-windows

  • PREREQUISITE: Uninstall existing node & npm
  • Install nvm-windows
  • Run nvm install <version>
  • Run nvm use <version>
like image 45
Jaider Avatar answered Sep 24 '22 10:09

Jaider


This happens due to dependencies from libraries like Heroku or yarn etc.., . Another hack-of-a-solution if you are stuck on this issue on MAC or any unix based system is:

Step 1: cd /Users/username/

Step 2: Do a ls -ltrh to list hidden files and locate .npm/ and .npm-packages/

Step 3: Sudo rm -rf .npm/

Step 4: Sudo rm -rf .npm-packages/

Step 5: Run brew reinstall node

Step 6: Run npm install -g [email protected] or any other version if there is a minor update needed

Step 7: Run npm install -g @angular/cli or any other framework to test

Step 8: Check versions node -v and npm --version

This issue should now be resolved.

like image 45
Maddy Anand Avatar answered Sep 22 '22 10:09

Maddy Anand