安装玩Ubuntu的虚拟机以后安装nodejs发现npm的版本才3.5.2,这都多老了?因而Google了一下,发现是因为Ubuntu官方维护的包源太老了,想要安装nodejs的最新版,两种方法,一种本身去官网下载,另外一种修改获取源node
我使用的是后者,参考地址:https://github.com/nodesource/distributionsgit
sudo apt install curl curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - sudo apt-get install -y nodejs
这样就修改了源的地址,下面开始安装nodejsgithub
sudo apt update sudo apt install nodejs