Home  >  Article  >  Operation and Maintenance  >  what is linux nvm

what is linux nvm

藏色散人
藏色散人Original
2023-03-27 10:22:182456browse

linux nvm refers to the Nodejs version manager, and its full English name is "Node Version Manager"; installing nvm under linux can quickly switch node versions, which means that the role of nvm is to help us quickly Switch node version.

what is linux nvm

The operating environment of this tutorial: linux5.9.8 system, nvm 6.9.0, Dell G3 computer.

What is linux nvm?

Install nvm under linux to quickly switch node versions

nvm (Node Version Manager) is a Nodejs version manager that can quickly switch between different node versions.

Why use NVM?

There are more and more node-based tools and projects, but the node version used by each project may be inconsistent, and some strange problems will occur. For example: The latest version of node is installed on your computer, but the project you take over uses a lower version of node. Then I can only switch to a lower version of node and perform the operation without error. NVM is used to help us quickly switch node versions.

nvm installation process in linux

Open the address of nvm in github: https://github.com/nvm-sh/nvm

what is linux nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

what is linux nvm

When you use nvm list at this time, you will be told that the nvm does not exist

what is linux nvm

Solution :

source ~/.bashrc

Then execute nvm list and you can see

what is linux nvm

nvm’s common commands

nvm list or nvm ls Check the installation version of node

nvm install 6.9.0 Install a 6.9.0 version of node

nvm use 6.9.0 Use this 6.9.0 version of node

nvm uninstall 6.9.0 Delete the node version 6.9.0

nvm ls-remote List the remote node version

nvm current View the node version currently in use

nvm alias default v4.3.0 switches v.4.3.0 to the default version. Every time you create a new command line, it will be the default version.

npm list --depth=0 -g View all npm packages installed globally

Recommended learning: "linux video tutorial"

The above is the detailed content of what is linux nvm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What does Linux fmt mean?Next article:What does Linux fmt mean?