How To Upgrade Node In Windows
Node.js is a popular open-source, cross-platform server-side environment for edifice robust applications. Since a vibrant community of contributors backs it, the platform is continuously updated to introduce new features, security patches, and other performance improvements.
And then, updating to the latest Node.js version can help you to make the about of the engineering. You can decide to work with the Long-term Supported (LTS) version or the Current version that comes with the latest features.
Typically, LTS is recommended for about users considering it is a stable version that provides predictable update releases besides as a slower introduction of substantial changes.
In this article, you will acquire how to quickly and easily update Node.js on different operating systems—macOS, Linux, and Windows.
As we'll demonstrate, there are many means of updating to the side by side version of Node.js. So, you can choose the pick that best meets your organisation requirements and preferences.
Checking your version of Node.js
Earlier getting started, y'all tin check the version of Node.js currently deployed on your system by running the following control on the concluding:
or (shortened method):
Let'due south now talk near the different means on how to update Node.js.
one. Updating using a Node version director on macOS or Linux
A Node version director is a utility that lets you install different Node.js versions and switch flawlessly betwixt them on your automobile. You can also utilise it to update your version of Node.js.
On macOS or Linux, you tin can use either of the following Node version managers:
- nvm
- n
Let's talk about each of them.
a) nvm
nvm is a script-based version manager for Node.js. To install it on macOS or Linux, y'all can utilize either Wget or roll.
For Wget, run the post-obit control on the terminal:
wget -qO- https: //raw.githubusercontent.com/nvm-sh/nvm/v0.35.three/install.sh | bash
For ringlet, run the post-obit:
gyre -o- https: //raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
The above commands presume that you lot're installing nvm version 0.35.3. And so, you'll need to cheque the latest version before installing information technology on your auto.
With these commands, you can clone the repository to ~/.nvm . This way, y'all can make changes to your bash profile, assuasive you to admission nvm system-wide.
To ostend if the installation was successful, you tin can run the following command:
If everything went well, it'd output nvm .
Next, you can simply download and update to the latest Node.js version past running the following:
Notation that node refers to an alias of the latest Node.js version.
Y'all tin also reference LTS versions in aliases as well as . nvmrc files using the note lts/* for the most recent LTS releases.
Here is an example:
If you want to install and upgrade to a specific version, yous can run the following:
nvm install <version-number>
For example, if you want to update Node.js to version 12.18.3, you can run:
Later on the upgrade, yous can set up that version to be the default version to use throughout your system:
You lot tin can see the list of installed Node.js versions past running this command:
Also, yous can see the listing of versions available for installation by running this command:
b) n
n is some other useful Node version manager you can employ for updating Node.js on macOS and Linux.
Since it's an npm-based packet , if you already have Node.js available on your environment, yous tin can simply install it by running this command:
Then, to download and update to your desired Node.js version, execute the following:
For example, if you desire to update Node.js to version 12.xviii.3, you can run:
To see a list of your downloaded Node.js versions, run n on its own:
You can specify to update to the newest LTS version by running:
You can as well specify to update to the latest current version past running:
Yous can specify to update to the newest LTS version by running:
2. Updating using a Node version director on Windows
On Windows, you lot tin utilize the following Node version director:
- nvm-windows
Let's talk about it.
a) nvm-windows
nvm-windows is a Node version management tool for the Windows operating arrangement. While it's non the same as nvm , both tools share several usage similarities for Node.js version management.
Earlier installing nvm-windows , it's recommended to uninstall any bachelor Node.js versions from your machine. This will avert potential disharmonize issues during installation.
Next, you tin can download and run the latest nvm-setup.zilch installer.
Besides, since the utility runs in an Admin trounce, you'll need to begin the Command Prompt or Powershell as an Administrator before using it.
If yous desire to install and upgrade to a specific version, y'all tin can run the following:
Yous tin can specify to update to the newest LTS version by running:
nvm install <version-number> |
For case, if you desire to update Node.js to version 12.18.iii, you lot tin can run:
After the upgrade, you tin can switch to that version:
Y'all can also specify to update to the latest stable Node.js version:
Y'all can come across the list of installed Node.js versions past running this command:
Too, you can meet the list of versions bachelor for download past running this command:
3. Updating using a Node installer on Linux
Using a Node installer is the to the lowest degree recommended way of upgrading Node.js on Linux. Nonetheless, if information technology's the simply route you can use, then follow the following steps:
- Go to the official Node.js downloads site , which has different Linux binary packages, and select your preferred congenital-in installer or source code. You can choose either the LTS releases or the latest current releases.
- Download the binary package using your browser. Or, you tin can download information technology using the following Wget control on the terminal:
- Download the binary package using your browser. Or, you tin download it using the post-obit Wget control on the concluding:
wget https: //nodejs.org/dist/v12.18.three/node-v12.eighteen.iii-linux-x64.tar.xz |
Retrieve to change the version number on the Wget command depending on the one yous desire.
- Install the xz-utils utility using the following command:
sudo apt-get install xz-utils |
This utility will exist used for unpacking the binary package.
- Finally, run the following command to unpack and install the binary package on usr/local:
tar -C /usr/local -strip-components 1 -xJf node-v12 .18.3 -linux-x64.tar.xz |
4. Updating using a Node installer on macOS and Windows
Another style of updating your Node.js on macOS and Windows is to become to the official download site and install the nigh recent version. This way, information technology'll overwrite your existing old version with the latest i.
You can follow the following steps to update information technology using this method:
- On the Node.js download folio, select either the LTS version or the latest current version.
- Depending on your system, click either the Windows Installer choice or the macOS installer option.
- Run the installation wizard. Information technology will magically complete the installation process and upgrade your Node.js version by replacing information technology with the new, updated one.
five. Updating using Homebrew on macOS
Homebrew is a popular package management utility for macOS.
To apply information technology for installing Node.js, run the post-obit command on your macOS final:
After, if you lot'd similar to update it, run the following commands:
brew update #ensure Homebrew is up to appointment first |
Furthermore, you can switch between installed Node.js versions:
Conclusion
That'southward how to upgrade your Node.js version on Linux, macOS, or Windows. With every update of Node.js, you can get enhanced features, increased security, improve compatibility with other technologies, and more.
You need to be updating Node.js constantly to improve your development experience and create versatile applications.
Happy coding!
Are yous letting open-source vulnerabilities go undetected?
WhiteSource Bolt is a powerful costless extension that operates in existent-fourth dimension to provide visibility over your open source components inside Azure Pipelines or GitHub.
- Get real-time alerts on security vulnerabilities
- Ensure the license compliance of open source components.
- Receive automated open-source inventory reports for every build or project.
Get it now and join thousands of developers who've already gained full visibility over their open up-source components.
Source: https://www.whitesourcesoftware.com/free-developer-tools/blog/how-to-update-node-js-to-latest-version/
Posted by: morrisonnotilen.blogspot.com
0 Response to "How To Upgrade Node In Windows"
Post a Comment