Like so many open minded technology, Node.js is a fast-moving job. Minor upgrades come out every couple of weeks to improve stability and safety among all variant branches.

Strategies abound for upgrading Node on almost any operating platform, so you don’t have an excuse to drop behind. We have compiled a few of the easiest and best techniques to install the most recent version of Node on tablet computers, Windows, and macOS machines. Before you begin, check which variant of Node.js you are currently using by conducting node -v at a command line terminal.

3 Methods to Update Node Versions on Linux-Based Machines

We are covering all of your bases with upgrading Node on Linux-based functioning systems, but Choice 1 is undoubtedly our most recommended strategy for simplicity and efficacy. If extenuating circumstances keep you from moving the Node Version Manager path, continue reading for instructions on upgrading Node through package supervisors or binary options.

1. Update Node Using Node Version Manager

Node Version Manager, or nvm, is far and away the best way to upgrading Node. You are going to require a C++ compiler, in addition to the build-essential and libssl-dev bundles. Run an update , and then get the bundles:

1
Two
sudo apt-get upgrade
sudo apt-get put in build-essential checkinstall libssl-dev

To set up or upgrade nvm, you can Find the install script with cURL:

1
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | celebration

You are going to need to close and reopen the terminal , however you can confirm a successful installation with control -v nvm. The control will lead nvm if everything else worked.

As soon as you’re setup, installing updated versions of Node is really a cinch. It is possible to check what variants are installed using nvm lsand see what’s available to set up using nvm ls-remote.

Download, compile, and install newer versions of Node using nvm install . #. #, obviously replacing the #s to your Node variant you desire. It is possible to inform nvm that version to use in every new shell with nvm usage #. #. # and specify a default option with alias: nvm alias default node.

2. Update Node With a Bundle Manager

If nvm is not for you, a package manager is the next best bet. Node bundle supervisor , or npm, makes it possible to find, discuss, and use code, together with handling dependencies.

Node includes npm pre-installed, but the supervisor is updated more often than Node. Run npm -v to determine which model you have, then npm set up npm@latest -gram to set up the most recent npm upgrade. Run npm -v again in the event that you would like to be certain npm upgraded properly.

To upgrade Node, you are going to require npm’s convenient n module. Run this code to clean npm’s cache, then install , and set up the Most Recent stable version of Node:

1
Two
3
sudo npm cache wash -f
sudo npm install -gram n
sudo n secure

To set up the most recent launch, use n latest. As an alternative, you can conduct n #. #. # to receive a specific Node variant.

3. Update Node (Ubuntu/Linux/Debian/ / CentOS) Using Binary Packages

Let us be fair — you probably don’t wish to go this path. If you are desperate, nevertheless, visit the official Node.js downloads page to acquire the 32-bit or 64-bit Linux binary file. It is possible to download the document in the browser, however we favor using the console. Remember the particular Node version may change as updates are published.

1
wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz

To unpack the file, you will want xz-utils; to put in it, run sudo apt-get set up xz-utils. Then use this code to put in the binary program in usr/local:

1
tar -C /usr/local –strip-components 1 -xJf node-v6.9.2-linux.x64.tar. xz

Now you have Node and npm, think about giving Choice two an attempt for another upgrade.

How to Update Node (Windows/macOS) Utilizing Installers on Nodejs.org

The Node.js downloads page incorporates binary packages for Windows and macOS — why make your life harder? The pre-made contractors — .msi for both Windows and .pkg for macOS — create the setup procedure incredibly efficient and clear. Download and then run the file, and allow the setup wizard deal with the rest. With every downloaded upgrade, the more recent variants of Node and npm will replace the old version.

Alternately, macOS users may use the npm and instructions above.

Your Own Node Update is Complete! How ‘Bout Your Modules and Packages?

Updating Node and npm is simply the start. You will want to keep the remainder of your packages and dependencies up to date to maximize security and compatibility. Lucky for you, you finally have the most recent edition of npm — and we have written a fantastic how-to guide which walks you through the bundle update procedure .

LEAVE A REPLY

Please enter your comment!
Please enter your name here