Ubuntu安装最新版的nodejs

Posted 齐建伟的博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu安装最新版的nodejs相关的知识,希望对你有一定的参考价值。

安装玩Ubuntu的虚拟机之后安装nodejs发现npm的版本才3.5.2,这都多老了?于是Google了一下,发现是由于Ubuntu官方维护的包源太老了,想要安装nodejs的最新版,两种方法,一种自己去官网下载,另一种修改获取源

我使用的是后者,参考地址:https://github.com/nodesource/distributions

sudo apt install curl
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs

这样就修改了源的地址,下面开始安装nodejs

sudo apt update
sudo apt install nodejs

 

以上是关于Ubuntu安装最新版的nodejs的主要内容,如果未能解决你的问题,请参考以下文章