how to update node js version(upgrade node version ubuntu)?

how to update node js version : One way to update your Node.js is to go to its official download page as well as install the newest release.

how to update node js version

Another way of updating your Node.js on macOS as well as Windows is to go to the official free download web site and here install the most latest version.

How to upgrade nodejs to latest version using pre-installed Node Package Manager (npm)?

upgrade node version ubuntu

First Check the version of installed npm using npm -v and then update it to latest version using npm install [email protected] -g · and then How to update Node.js and NPM to next version ?

Read Also:  jQuery Ajax Image Upload without Page Refresh using PHP

How to upgrade Node.JS to the latest version?

upgrade node version ubuntu

step 1. First, clear the npm cache:

//For Window:
npm cache clean -f
 
//For Linux, Ubuntu or MAC
sudo npm cache clean -f

step 2. Install n, Node’s version manager:

//For Window:
npm install -g n
 
//For Linux, Ubuntu or MAC
sudo npm install -g n

step 3. Install the latest stable version:

//For Window:
n stable

//For Linux, Ubuntu or MAC
sudo n stable

How to upgrade nodejs to latest version using Node Version Manager (nvm):

step 1. update the package repository

sudo apt update

step 2. free Download the required all the dependencies

sudo apt install build-essential checkinstall libssl-dev

step 3. Install NVM using the curl command:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.1/install.sh | bash

You can use Wget as well.

Read Also:  jQuery Ajax POST example with Laravel 5.7

Here’s the simple and best script:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

step 4. Close as well as reopen the terminal.

5. After that, double verify if you have successfully or not installed NVM:

nvm --version

step 6. Before upgrading Node.js sever, check which Latest version you have running on the system:

nvm ls

step 7. And then you can check for Latest available releases with:

nvm ls-remote

step 8. Download and install a Latest version of node.js.

nvm install #.#.# 

OR

nvm install version.number

Don’t Miss : install npm windows

I hope you get an idea about how to update node js version.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.