How to Update Node Js Latest Version on Linux, Mac OS & Windows

node js latest version

Node.js, the open-source JavaScript runtime environment, has an active community of users. This is the reason that why there’s a need to consider the minor updates of the software. Importance of 

Why you should use Node.js? It’s a cross-platform JavaScript environment, finds use for server-side scripting. It comes with the non-blocking workflow that makes Node.js incredibly popular among web developers. The purpose is to build a dynamic web application. 

Node Package Manager, which is popularly referred to as the npm, is the package manager for Node.js that serves as a command-line utility. That said, the objective is to interact with the npm online repository for package installation. 

Installing Node JS

When you install node js, the other services include version management and dependency management. Working with updated Node.js versions and npm means one can get better performance and added features. The improved Node.JS version means that you can expect better stability or features. 

Node.js as a Layer of MEAN Stack 

Using Node.js as a layer of the MEAN stack is possible. The other way to update node js is consideration of the different JS frameworks. Regardless of what the situation is, ensure that you update Node.js regularly, which guarantees system security.

There are several ways of installing node js on Linux and NPM. Similarly, you can also opt for the different ways to update the Node.js version, depending on the operating system. You can also update the node to specific version windows.

Learn how to update node js latest version. The steps will be valid for Linux, Windows, and macOS.

Update Node.js to Linux Systems

Updating Node.js is the easiest with using Node Version Manager and most recommended. However, the alternative to this method is the method for updating with the local package manager. The third one is through downloading the binary packages.

Method 1: NVM (Node Version Manager)

NVM serves as the practical tool for managing multiple Node.js versions. Nvm serves in the form of the script-based version manager of Node.js. Also, there is a scope to update the version of Node.js on Linux or macOS with Wget or cURL.

How to update the NVM version?

For the installation of the 38.0 version of nvm, you will have to update with Wget. Make sure that you consider this command:

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

1. Updating the package repository with a command which is sudo apt update

2. Ensure that you install NVM using the curl command:

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

Alternatively, the most favorable option will be using wget and running the command:

wget -q0- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

3. Close and reopen the terminal for the recognition of the changes or run the command:

source ~/.bashrc

5. Verify if the installation of the NVM has been successful or not.

6. Before you upgrade the Node.js, make sure to check the version running on the system:

7. Check for newly available releases with:

nvm ls-remote that also lets you know about all the available Node.js versions

8. For installation to the latest version, use the nvm command that comes with the Node.js version:

nvm install [version.number]

Method 2: 

Updating Node.js with NPM

NPM, the abbreviation of the Node Package Manager, serves in the form of an alternative. In that case, you will have to take into consideration the Node’s official package manager that can help update Node.js. NPM serves as the tool for installing and managing package dependencies. Upgrade npm package to the latest by following a set of simple steps. 

When you have Node on your system, it will also have NPM to update node version. With the npm command, there’s a way to check running Node.js versions and install the latest release.

The addition of the n module means that there’s a scope for interactive management of the Node.js versions.

1. Clear the npm cache:

2. Install n, which is the Node’s version manager

3. When there is n module installed, use it for the install latest stable version:

Installation of the latest release:

sudo n latest

Installation of a specific version:

sudo n [version.number]

Method 3: 

Updating Node.js with Binary Packages

Update with the help of the binary packages isn’t the most recommended option. But in case you notice that the other options do not work properly, you can upgrade to the latest Node.js version using this method.

1. Go to Node’s official downloads page to find all available packages. Download the source code. The alternative to it is downloading the pre-built installer for the LTS versions or the latest release.

2. Either download the package from your browser or choose to find the version number needed and add it to the wget command:

wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz

3. Ensure that you install xz-utils used to extract the binary package:

sudo apt-get install xz-utils

4. Extract>>>install the package. With that, the command you need to follow is as follows:

sudo tar -C /usr/local –strip-components 1 -xJf node-v14.17.0-Linux-x64.tar.xz

Updating on macOS and Windows using a Node installer

The best way you can continue with the up-gradation is by considering the official download site and installation of the most recent version. This is the best way to do so as it gives the scope for overwriting your old version with the latest one.

Follow the following steps for node installation of macOS:

Go to the Node.js download page when it comes to installing nodejs on windows. Make sure that you select either the LTS version or the latest current version.

Based on the system type and the additional details, make sure to click either the Windows Installer option or the macOS installer option.

To update node version windows, run the installation wizard that will help to complete the installation process. In addition to that, you can also choose to upgrade the Node.js version by replacing it with the new, updated one.

5. Homebrew on macOS: One of the most favorable options

Homebrew serves in the form of the popular package management utility for macOS.

For the installation of Node.js, run the command on your macOS terminal:

brew install node

In case you want to update it, run the commands:

  • brew update #ensure Homebrew is up to date first
  • brew upgrade node

 The alternative to it is switching between installed Node.js versions:

  • brew switch node 12.18.3

Key Takeaways

We have listed the applicable steps that you need to follow to upgrade your Node.js version. You must note that updating Node.js benefits you in the manner that you will get the list of the improved functionalities, healthier compatibility levels and boost in security. 

So, ensure that you are updating Node.js constantly for bringing in a heightened user experience and produce adaptable applications.

Leave a Reply

Your email address will not be published. Required fields are marked *