xiaozefeng / ubuntu-guide

0 stars 0 forks source link

Ubuntu 18 安装 node #9

Open xiaozefeng opened 3 years ago

xiaozefeng commented 3 years ago

使用nvm 安装 node

安装 nvm

  1. curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh -o install_nvm.sh
  2. bash install_nvm.sh
  3. 安装成功后会提示讲一些命令加入到 ~/.bashrc
    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 bash_completion
  4. source .bashrc

安装 node

  1. nvm ls-remote , 找到一个 LTS的版本
  2. nvm install 指定版本