Home > Net >  Why does node show different versions?
Why does node show different versions?

Time:10-07

Why is this error displayed if node version v16.17.1?

enter image description here

ERROR: npm is known not to run on Node.js v10.19.0

UP---

I had several versions of node. The old version was installed by default. Solved the problem using nvm.

CodePudding user response:

I had several versions of node. The old version was installed by default. Solved the problem using nvm.

CodePudding user response:

You can use the npm n module to upgrade node

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

If you prefer to upgrade to the latest version instead of the stable use

sudo n latest

Restart terminal and you should be good to go.

DISCLAIMER: avoid this if you're in a production environment as it could mess the npm packages.

  • Related