如何修复 Linux 19.04 上的 Node.js 安装过程

如何修复 Linux 19.04 上的 Node.js 安装过程

在我的系统 Ububntu 19.04 上运行,我发现安装 nodejs 很困难

跑步后sudo apt install nodejs

我收到以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libc-ares2 libnode64 libuv1 nodejs-doc
Suggested packages:
  npm
The following NEW packages will be installed:
  libc-ares2 libnode64 libuv1 nodejs nodejs-doc
0 upgraded, 5 newly installed, 0 to remove and 143 not upgraded.
Need to get 6452 kB/6489 kB of archives.
After this operation, 29,4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://gr.archive.ubuntu.com/ubuntu disco/main amd64 libuv1 amd64 1.24.1-1
  404  Not Found [IP: 2001:67c:1562::15 80]
Err:2 http://gr.archive.ubuntu.com/ubuntu disco/universe amd64 libnode64 amd64 10.15.2~dfsg-1
  404  Not Found [IP: 2001:67c:1562::15 80]
Ign:3 http://gr.archive.ubuntu.com/ubuntu disco/universe amd64 nodejs-doc all 10.15.2~dfsg-1
Err:4 http://gr.archive.ubuntu.com/ubuntu disco/universe amd64 nodejs amd64 10.15.2~dfsg-1
  404  Not Found [IP: 2001:67c:1562::15 80]
Err:3 http://gr.archive.ubuntu.com/ubuntu disco/universe amd64 nodejs-doc all 10.15.2~dfsg-1
  404  Not Found [IP: 2001:67c:1562::15 80]
E: Failed to fetch http://gr.archive.ubuntu.com/ubuntu/pool/main/libu/libuv1/libuv1_1.24.1-1_amd64.deb  404  Not Found [IP: 2001:67c:1562::15 80]
E: Failed to fetch http://gr.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/libnode64_10.15.2~dfsg-1_amd64.deb  404  Not Found [IP: 2001:67c:1562::15 80]
E: Failed to fetch http://gr.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/nodejs-doc_10.15.2~dfsg-1_all.deb  404  Not Found [IP: 2001:67c:1562::15 80]
E: Failed to fetch http://gr.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/nodejs_10.15.2~dfsg-1_amd64.deb  404  Not Found [IP: 2001:67c:1562::15 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

出了什么问题?我该如何解决?

答案1

为什么要绕到脑后去够鼻子,而不是直接往上够呢?下面是解决办法。前往 nodejs.org 并下载稳定版。单击显示 LTS 版本的绿色大按钮。下载后,右键单击以查看选项。选择“使用存档管理器打开”选项。它会将文件解压到您的下载文件夹中。现在转到“软件中心”(带有“购物袋”图标)并搜索 Node 或 Node JS。您将找到熟悉的绿色 Node JS 图标 Node JS。单击安装并启动。就是这样。启动终端并输入“node --version”。您将看到版本号。您已在系统中安装了 Node.js。

相关内容