繁体   English   中英

无法在Ubuntu 16.04上安装节点

[英]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

然后跑

  • umake的nodejs

它安装了可用的最新版本(v8.2.1)

或者,您也可以使用nvm

详细说明在这里

注意如果使用ubuntu-make ,则可能必须注销并登录

然后通过node -v检查您的版本

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM