nvm安装使用

一.安装

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

   中间它会给出:
  Append the following lines to the correct file yourself
  
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
 类似的提示,这是要你把这段代码复制到.bash_profile(环境变量文件中),如果没有就创建一个,touch .bash_profile,再打开 open .bash_profile,复制进去就好
二.使用

nvm ls-remote:列出所有可以安装的node版本号
nvm install v10.4.0:安装指定版本号的node
nvm use v10.3.0:切换node的版本,这个是全局的
nvm current:当前node版本
nvm ls:列出所有已经安装的node版本

 

 

posted @ 2019-11-15 10:50  我的TURF  阅读(230)  评论(0编辑  收藏  举报