📅  最后修改于: 2023-12-03 15:33:15.577000             🧑  作者: Mango
NVM (Node Version Manager) is a tool that makes it easy to install and manage multiple versions of Node.js on a single machine. In this guide, we'll go over the installation process for NVM on Mac.
Note: You must have Homebrew installed to use the recommended installation method for NVM.
brew install nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo 'source $(brew --prefix nvm)/nvm.sh' >> ~/.bash_profile
NVM comes with several useful commands that make it easy to manage different Node.js versions. Here are a few examples:
nvm install 14.16.0
nvm use 14.16.0
nvm ls
nvm alias default 14.16.0
NVM is a powerful tool that simplifies the process of managing multiple versions of Node.js on your Mac. With just a few simple commands, you can easily switch between different versions of Node.js, install new versions, and manage your environment with ease. If you're a Node.js developer, NVM is a must-have tool in your toolkit!