5

How To Upgrade NVM, NPM, Node, and NPX

 2 years ago
source link: https://kenanbek.medium.com/how-to-upgrade-nvm-npm-node-and-npx-97f927dddd22
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How To Upgrade NVM, NPM, Node, and NPX

As a “backender” in the world of ̶J̶a̶v̶a̶S̶c̶r̶i̶p̶t̶ frontend, I was looking for commands and options on keeping versions of core components consistent. That’s mainly about NVM, NPM, Node.js, and NPX.

At the moment (16 April 2022), the most recent version of NVM is v0.38.0, and to install or update NVM use this command (I will keep this command updated):

# with curlcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash# or, with wgetwget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

Install Node

brew update
brew install npm

To upgrade the version of NPM, use the following command:

npm install -g npm@latest

Node.

Once you have nvm installed you can use the following command to get the latest stable version of Node.js:

nvm install stable

Since NPX is also a Node package we can use NPM to install or update it:

npm install -g npx

Yarn.

Install Yarn:

npm install -g yarn

If you want to upgrade the current installation of Yarn, use the following command:

yarn set version latest

Addon: How To Check The Version for NVM, NPM, Node, and NPX

Use the following command to check the version for NVM, NPM, Node, and NPX:

echo nvm npm node npx yarn && nvm --version && npm -v && node -v && npx -v && yarn -v

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK