how do I update Node.js using cmd?
Asked Answered
C

2

10

Update Node.js version using command prompt
My installed version is

v14.15.1

LTS version is

v14.17.1

Using below two commands

install npm

npm install -g npm stable

install node using

npm install -g node

using command also but the version is not updated

Screenshot of  command Prompt

Castrato answered 26/6, 2021 at 3:55 Comment(0)
C
9

its Works

1. sudo npm cache clean -f

2. sudo npm install -g n

3. sudo n stable

stabilize version installed

Castrato answered 21/3, 2022 at 6:46 Comment(0)
C
5

You install nvm first (Node Version Manager):

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

Then you say nvm install <version>.

And when you want to upgrade... it's as easy as nvm install <version>

And you can switch between Node versions:

nvm use <version>`

And by adding a .nvmrc file into the root of your project, you can wire up your shell to automatically switch to the version of Node.js specified in the .nvmrc file.

Conserve answered 26/6, 2021 at 4:9 Comment(3)
install LTS version 14.17.1 but installed current version 16.4.0Castrato
Just use the proper incantation if you want version 14 (lts/fermium): Just say nvm install --lts=fermiumConserve
Node.js v--lts=fermium.0.0 is only available in 32-bit.Castrato

© 2022 - 2024 — McMap. All rights reserved.