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:
There are three possible ways to update a Node.js version:
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>
Homebrew is another popular package installer on macOS. To update a Node.js version using Homebrew, use the following command:
brew upgrade node
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.
View all Courses