[英]Unable to install node on Ubuntu 16.04
我從Windows移至ubuntu,並按照站點上的說明進行操作-https: //nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
跟隨命令成功運行
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
然后
sudo apt-get install -y nodejs
上面命令的輸出是:
$sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (4.2.6~dfsg-1ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 519 not upgraded.
如您所見,盡管我嘗試安裝8+,但它采用了版本4的nodejs。
我用刪除了nodejs
sudo apt-get remove nodejs
但仍然嘗試再次說同樣的話。 請注意,該設置是新的,以前沒有安裝任何東西
我不確定,但我想要“節點”,為什么要嘗試安裝node.js
如果我嘗試這樣做-
$ sudo apt-get install node
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package node is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'node' has no installation candidate
一旦有了版本4,就可以將其更新為最新版本。 請參閱本主題將Node.js升級到最新版本
嘿,我使用Ubuntu 16最新的LTS
您可以做的是安裝ubuntu-make
然后跑
它安裝了可用的最新版本(v8.2.1)
或者,您也可以使用nvm
詳細說明在這里
注意如果使用ubuntu-make
,則可能必須注銷並登錄
然后通過node -v
檢查您的版本
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.