无论我如何尝试,我最终都会使用 nodejs 4.2.6。是笑话吗?
$ nodejs -v
v4.2.6
卸载和 4.2.6 像病毒一样返回
$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 73 not upgraded.
Need to get 0 B/3 161 kB of archives.
After this operation, 13,2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 434000 files and directories currently installed.)
Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4.1_amd64.deb ...
Unpacking nodejs (4.2.6~dfsg-1ubuntu4.1) ...
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.1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
这是因为 Ubuntu 默认提供了这个版本的 node js。当我安装时,我得到了一个类似的版本。
然后我按照这个指南。我能够安装最新版本。最好的方法是从官方节点站点下载二进制文件。然后解压缩包并将其添加到系统路径位置。