This will download the nvm installation script and run it.
Once the installation is complete, you’ll need to add the following line to your shell configuration file (e.g. ~/.bashrc or ~/.zshrc) to enable nvm:
source ~/.nvm/nvm.sh
复制代码
Reload your shell configuration file by running:
source ~/.bashrc
复制代码
(or source ~/.zshrc if you’re using zsh)
Verify that nvm is installed by running:
nvm --version
复制代码
This should display the version of nvm that you just installed.
That’s it! You should now be able to use nvm to manage multiple versions of Node.js on your Ubuntu system.
Note: If you’re using a newer version of Ubuntu, you may need to use the curl command with the -s flag to suppress the progress meter, like this: