This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3376|Reply: 2

Use NVM to install and manage node.js releases

[Copy link]
Posted on 11/29/2023 10:35:43 PM | | | |
NVM, short for Node Version Manager, is a command-line tool that allows you to quickly install and use different versions of node.js via the command line. You can easily switch node versions, and you can coexist with multiple versions of nodes.

NVM Linux Version:The hyperlink login is visible.
NVM Windows Version:The hyperlink login is visible.
NVM Windows Desktop Version:The hyperlink login is visible.

This article is mainly a demonstration of using NVM to install and manage Node versions on a Linux (ubuntu 22) server.

Installation

Install using the curl command, as follows:

Running the command downloads the script and runs it. The script clones the nvm repository to ~/.nvm and tries to add the source line from the code snippet below to the correct configuration file (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.sour).

As shown below:



Verify the installation

To verify that NVM is installed, do the following:

nvm should output if the installation is successful. Note thiswhich nvm will not work, because itnvm is a source shell function, instead of executable binaries.

Note: On Linux, after running the installation script, if you receive or don't see any feedback from the terminal after typing command -v nvm, simply close the current terminal, open a new terminal, and try to verify again.


Download

NVM is downloaded from the node official website by default, and foreign servers are bound to be slow. NVM supports downloading packages from the mirror server, so we just need to add an environment variable NVM_NODEJS_ORG_MIRROR. The command is as follows:

As shown below:



Try to install the specified version with the following command:



(End)




Previous:.NET/C# sets the default CultureInfo information for the program
Next:curl wget ignores turning off https certificate validation
 Landlord| Posted on 3/21/2024 11:09:00 AM |
nvm install the latest LTS version and use it

 Landlord| Posted on 7/22/2024 9:14:48 AM |
Change the npm image address to Taobao image
https://www.itsvse.com/thread-7814-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com