Debian安装最新版nodejs及npm

安装

#先删除原有版本
apt-get remove  nodejs npm -y --allow-remove-essential

#执行安装
curl -sL https://deb.nodesource.com/setup_12.x | bash -
#
apt-get install  gcc g++ make -y --allow-remove-essential
#
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
#
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
#
apt-get update &&  apt-get install yarn -y --allow-remove-essential

配置

更改npm安装源

npm config set registry https://registry.npm.taobao.org

   转载规则


《Debian安装最新版nodejs及npm》 helen 采用 知识共享署名 4.0 国际许可协议 进行许可。
  目录