Linux uses NVM to manage Nodejs

 Since Nodejs is an ecosystem with great compatibility problems, how to make different versions of Nodejs coexist and manage will be a very important block. NVM is used to deal with this problem.

installation

First go to the official Github Repo to check the latest version, and remember to replace the command with the latest version.

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
source ~/.bashrc

After the installation is complete, check the version.

nvm –version

List local version

nvm ls

There should be no Nodejs version when NVM is first installed.

List remote installable versions

It is recommended to install LTS for the newer versions. For some old applications, only certain old versions can be executed and must be downloaded.

nvm ls-remote

Install the specified version

Will automatically download and install the specified node version from the remote.

nvm install v12.20.2

Use node -v to check the version after installation.

Use specified version

You can use the screen command to use different versions in different sessions.

nvm use v12.20.2

View more information about the current version

Can be used to check the actual location of node execution files... etc.

npm config list

Comments

Popular posts from this blog

Getting started with Gradle-Grovvy language foundation

Linux Command Pipeline basic teaching

Gradle configuration Spring multi-project test