当我尝试在新的 Ubuntu Server VM 上安装 NodeJS 时,我遇到了一个奇怪的问题。
我执行了官方说明中的两个简单步骤,但不知何故我失败了。
在我的用户的主目录中,我执行curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
成功结束,然后sudo apt-get install -y nodejs
但这会导致安装 v.4.2.6。
输出如下所示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/3161 kB of archives.
After this operation, 13,2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 97187 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 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
请帮忙。