gpt4 book ai didi

node.js - 无法更新nodejs ubuntu 15.01版本

转载 作者:太空宇宙 更新时间:2023-11-03 22:52:52 24 4
gpt4 key购买 nike

我不明白为什么即使我在nodejs的网站上写了完全相同的行也无法实现 nodejs documentation says that

for Alternatively, for Node.js v5:

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs

当我按照上面的说明操作时;

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 218 not upgraded.
Need to get 0 B/684 kB of archives.
After this operation, 3.116 kB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 175307 files and directories currently installed.)
Preparing to unpack .../nodejs_0.10.25~dfsg2-2ubuntu1_amd64.deb ...
Unpacking nodejs (0.10.25~dfsg2-2ubuntu1) ...
Processing triggers for doc-base (0.10.6) ...
Processing 1 added doc-base file...
Processing triggers for man-db (2.7.4-1) ...
Setting up nodejs (0.10.25~dfsg2-2ubuntu1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode

正如你所看到的;

Preparing to unpack .../nodejs_0.10.25~dfsg2-2ubuntu1_amd64.deb ...

如何安装最新版本?

最佳答案

检查当前 Node.js 版本:

Node -v

强制清理缓存:

sudo npm cache clean -f

安装n个模块:

sudo npm install -g n

安装最新的 Node.js:

sudo n stable

设置二进制链接(将 7.6.0 更改为您安装的任何版本):

sudo ln -sf/usr/local/n/versions/node/7.6.0/bin/node/usr/bin/node

再次检查 Node.js 版本:

Node -v

您可以check this link .

关于node.js - 无法更新nodejs ubuntu 15.01版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36326403/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com