
To install the latest stable version of Node.js, run the following command: n stable You can install it with the following command: npm install -g n Next, you will need to install the “n” Node’s version manager in your system. If Node.js is installed in your system then you have NPM also installed.įirst, clear the NPM cache using the command below: npm cache clean -f It is used for installing and managing Node.js dependencies. NPM stands for “ Node Package Manager” is a package manager for Node.js. Next, install your desired version of Node.js from the above output as shown below: nvm install node-versionįor example, to install the Node.js version v15.6.0., run the following command: nvm install v15.6.0 Update Node.js Version Using NPM

Next, print a list of all available Node.js version using the following command: nvm list-remote Next, verify the NVM version with the following command: nvm -version Next, close and reopen the terminal or run the following command to activate the profile. Next, go to the NVM Git Repository page then download and run the NVM installation script using the following command: curl -o- | bash. NVM allows you to install and manage multiple Node.js versions.įirst, update your system packages with the following command: apt-get update -y The Simple and easiest way to update Node.js version is with Node Version Manager.

There are several ways you can update your Node.js version in Linux system. If your application is running on the Node.js server then I would recommend updating Node.js version regularly to improve the security. You already know how to install Node.js and NPM using three different ways. It is primarily used for non-blocking, event-driven servers, traditional web sites and back-end API services.

Node.js is an open-source and cross-platform JavaScript runtime environment used to run JavaScript code on the server-side.
