这些是我在Ubuntu 16.04上安装节点的步骤:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y npm
这是官方说明:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
完成此操作后,运行nodejs --version
return v4.2.6
。
正如我以前所使用的那样,setup_6.x
我假设6
将安装一个以开头的版本?
我以为setup_6.x
应该是setup_6.2.1
,但是该页面返回404,请参阅:
https://deb.nodesource.com/setup_6.x(那里有一个页面)
https://deb.nodesource.com/setup_6.2.1(返回404)
如何在Ubuntu 16.04上安装最新稳定的node版本?
编辑:
这些是运行后的结果sudo apt-get install -y nodejs
:
sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp libboost-python1.58.0 libjs-inherits libjs-node-uuid libjs-underscore
libssl-dev libssl-doc libuv1-dev linux-headers-4.4.0-18
linux-headers-4.4.0-18-generic linux-headers-4.4.0-21
linux-headers-4.4.0-21-generic linux-image-4.4.0-18-generic
linux-image-4.4.0-21-generic linux-image-extra-4.4.0-18-generic
linux-image-extra-4.4.0-21-generic linux-signed-image-4.4.0-18-generic
linux-signed-image-4.4.0-21-generic python-configobj python-pycurl
python-pyexiv2 python-pyexiv2-doc
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
nodejs
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 0 B/3,162 kB of archives.
After this operation, 13.2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 329473 files and directories currently installed.)
Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4_amd64.deb ...
Unpacking nodejs (4.2.6~dfsg-1ubuntu4) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 added doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (4.2.6~dfsg-1ubuntu4) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
编辑:
结果apt-cache policy nodejs
:
apt-cache policy nodejs
nodejs:
Installed: 4.2.6~dfsg-1ubuntu4
Candidate: 4.2.6~dfsg-1ubuntu4
Version table:
*** 4.2.6~dfsg-1ubuntu4 500
500 http://au.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
100 /var/lib/dpkg/status
apt-cache
数据,以便我们可以看到您的计算机在存储库中看到的内容,我们也许可以提供进一步的帮助。
apt-cache policy nodejs
请的输出副本作为问题编辑到您的问题中。