Ini adalah langkah-langkah saya untuk menginstal node di 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
yang merupakan instruksi resmi:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
Setelah melakukan ini, menjalankan nodejs --version
kembali v4.2.6
.
Seperti yang saya gunakan, setup_6.x
saya mengasumsikan versi yang dimulai dengan 6
akan diinstal?
Saya pikir mungkin setup_6.x
seharusnya setup_6.2.1
, tetapi halaman itu mengembalikan 404, lihat:
https://deb.nodesource.com/setup_6.x (ada halaman di sana)
https://deb.nodesource.com/setup_6.2.1 (mengembalikan 404)
Bagaimana cara menginstal versi stabil terbaru dari node pada Ubuntu 16.04?
Sunting:
Ini adalah hasil setelah berjalan 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
Sunting:
Hasil dari 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
data sehingga kami dapat melihat apa yang dilihat komputer Anda dalam repo, kami mungkin dapat membantu lebih lanjut.
apt-cache policy nodejs
silakan ke pertanyaan Anda sebagai hasil edit.