How to update Node.js and NPM to next version ?
- Go to this site: https://github.com/coreybutler/nvm-windows/releases
- Install and unzip the nvm-setup.zip file
- From cmd type nvm -v to ensure nvm is installed.
After installing nvm, the following can be done to update Node.js to the latest version:
nvm install <version>
Check the list of available Node.js version in the system using the following command:
To use the desired version, use the following command:
nvm use <version>
Update npm: To update NPM, use the following command:
npm install -g npm
Below is a demonstration for updating Node.js and npm versions for Linux systems. Install nvm in Linux:
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash OR # wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
Check if nvm is installed successfully
Open a new terminal nvm -v
To install latest version of node, use the following command.
# nvm install node or # nvm install --lts or # nvm install
Check all the available version of node on the system:
# nvm ls
Use a particular version
# nvm use
Update npm to latest version:
# npm install -g npm
Please Login to comment...