- Open a terminal and run the following command to install the required packages:
- sudo apt-get update
- sudo apt-get install build-essential libssl-dev
复制代码
- Then, run the following command to download and install nvm:
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash
复制代码 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:
- Reload your shell configuration file by running:
(or source ~/.zshrc if you’re using zsh)
- Verify that nvm is installed by running:
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:
- curl -s -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | bash
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |