I cannnot update node with n

698 Views Asked by At

I'm trying: sudo n stable and get: installed: v14.17.6 (with npm 6.14.15) but the version is still old: node -v v11.14.0

3

There are 3 best solutions below

2
Bibek Khatri On

What OS are you using? If it's macOS or Linux, you can simply override the current version on your machine by installing the node version of your choice. You can download and install node from:

https://nodejs.org/en/

Or, you can use a version manager like nvm to switch between different versions of node. nvm can be installed on Linux and macOS.

https://github.com/nvm-sh/nvm

If you are using Windows, simply download the installer executable file from the first link and follow the steps shown by installer.

0
shadowspawn On

You may have more than one version of node installed, and when you run node the "other" version is found earlier in your PATH.

Check where the active version is with:

$ command -v node
/usr/local/bin/node

You can run n doctor which has checks for some setup problems including this.

$ n doctor
...
CHECKS

Checking n install destination is in PATH...
good

Checking n install destination priority in PATH...
good
...
0
tperamaki On

I had the same problem, and I believe the reason for it was that I had installed it previously using nvm. Using nvm to install the latest version worked for me.