Settings / JavaScript runtime environment. / How to Update Node.js Version {Linux, Windows, & macOS}
How to Update Node.js Version {Linux, Windows, & macOS}
-
on Linux
Option1: Node.js with NVM
sudo apt update //install curl sudo apt install curl // Install nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash OR wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash source ~/.bashrc //verify nvm --version //Before upgrading Node.js, check which version you have on the system: nvm ls //Now you can check for the available releases by running: nvm ls-remote //To install the latest version, use the nvm command with the specific Node.js version: nvm install [version_number] //If there are multiple Node.js versions, use the following command to list installed versions: nvm ls //Then, switch to a specific version with: nvm use [version_number] Option 2: Update Node.js with n
// Clear the npm cache: npm cache clean -f //Install n, Node's version manager: sudo npm install -g n //Install the latest stable version: sudo n lts //Install the latest release: sudo n latest //Install a specific version: sudo n [version_number] //To switch between installed versions, run n without any options: sudo n -
on macOS
Option 1: Update Node.js with macOS Installer
1. Navigate to the official Node.js website and download the macOS installer for the latest version. Choose the LTS (long-term support) version for the latest stable version or the Current version for bleeding-edge features.
2. When the process completes, verify the installation by running the command below:
node -v Option 2: using nvm
//Check the currently installed Node.js version: nvm ls //Run the command below to install the latest stable Node.js version: nvm install node //Once the installation is complete, switch to the newly installed Node.js version using the syntax below: nvm use [version] Option 3: using n
//Install n using npm if you do not have it installed yet. Run the command below: sudo npm install -g n // Update Node.js using one of the commands below, depending on your preference: sudo n stable sudo n latest sudo n lts -
on Windows
Option 1: Update Node.js with Windows Installer
1. Navigate to the official Node.js website and download the LTS (latest stable version) or Current (latest version with newest features) program version installer for Windows.
2. Run the following command in a command prompt or PowerShell window to update npm:
npm install -g npm@latest Option 2: Update Node.js using nvm
1. Navigate to the GitHub nvm releases page and scroll down to the Assets section. From the list, choose your preferred installation method. For this tutorial, we will use the executable file:
2. download nvm-setup.exe
3. Open a command prompt or PowerShell window and use the syntax below to update Node.js with nvm:
nvm install [version_number] 4. To activate the installed version, use the syntax below:
nvm use [version_number]
MANVIA BLOG