Loading... ### Ubuntu16.04安装node.js和npm > 安装环境:实体机Ubuntu16.04.4 LTS 虚拟机Ubuntu16.04.1 LTS <!--more--> 0. 更新软件源与添加ppa源: sudo apt-get update sudo apt-get install -y python-software-properties software-properties-common sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update 1. 安装node.js、依赖关系以及npm: sudo apt-get install nodejs sudo apt install nodejs-legacy sudo apt install npm 2. 更换npm的源为TaoBao源(据说良心源,同步间隔10分钟,国内速度安稳): sudo npm config set registry https://registry.npm.taobao.org sudo npm config list 3. 拖过npm安装n管理器与node.js(stable版本): sudo npm install n -g sudo n stable 4. 查看一下安装的版本: sudo node -v sudo npm -v Last modification:March 26, 2019 © Allow specification reprint Like 0 If you think my article is useful to you, please feel free to appreciate