0

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

derpirscher
  • 14,418
  • 3
  • 18
  • 35
  • What OS are you on? Do you have a `node` package installed by your OS (or for instance homebrew or something similar)? What is the output of `which node` – derpirscher Sep 07 '21 at 10:42

3 Answers3

0

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.

Bibek Khatri
  • 292
  • 3
  • 7
0

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
...
shadowspawn
  • 3,039
  • 22
  • 26
0

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.

tperamaki
  • 1,028
  • 1
  • 6
  • 12