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

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!



Solution 1:[1]

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>

Solution 2:[2]

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.

Solution 3:[3]

on windows: *Uninstall node.js (Windows Add/Remove programs) *Manually delete the npm folder from your user profile (%APPDATA%/roaming/npm) *Install node.js (from Windows 10 LTS download MSI)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jaider
Solution 2 Maddy Anand
Solution 3 Mounir bkr