Ubuntu安裝最新版的nodejs

安裝玩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

相關文章
相關標籤/搜索