Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

node
js
version
update

How to update Node.js

Educative Answers Team

There are multiple ways to install Node.js; therefore, depending on how it was installed, there are numerous ways to update its version as well.

First, check which version of node is currently running on your system using the command:

node -v

Ways to update

There are three possible ways to update a Node.js version:

1. Updating using nvm

The node version manager nvm is a popular way of running Node – it allows us to switch between various Node versions and install new versions.

To update using nvm, use the following two commands:

nvm install <VERSION_NUMBER>
nvm use <VERSION_NUMBER>

2. Updating using Homebrew (macOS)

Homebrew is another popular package installer on macOS. To update a ​Node.js version using Homebrew, use the following command:

brew upgrade node

3. Updating using official installer

The official Node.js downloads page includes pre-made installers for Windows and macOS; download and run these installers to update your version of Node.js. Newer versions of Node.js will automatically replace ​older versions.


RELATED TAGS

node
js
version
update
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring