寫在前面:VSCode報錯問題解決方案:https://github.com/creationix/nvm/issues/1690
I fixed this temporarily by adding nvm use node to the end of my .bash_profile after the nvm path export.
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm
nvm use node
c
1.安裝(Centos)
可以通過curl或者wget進行安裝,命令如下:
首先要安裝git
yum install git
curl方式
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
wget方式
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
如果提示找不到命令,嘗試
source ~/.bashrc
2.常用命令
nvm ls-remote //列出全部可以安裝的版本號
nvm ls //列出已安裝版本號
nvm install //安裝指定版本號
nvm use //切換到指定版本號
nvm current //查看當前使用的版本號
nvm uninstall //卸載指定版本號