0

nodejs 已经安装好了,可以通过 nodejs --version 输出来判断。 npm 安装问题

另外,请注意,当我尝试升级节点时,在执行 apt-get 更新时出现以下错误:

sudo apt-get update
.
..
Err:13 http://extras.ubuntu.com/ubuntu xenial/main Sources                                                        
  404  Not Found [IP: 91.189.92.152 80]
Ign:17 http://extras.ubuntu.com/ubuntu xenial/main amd64 Packages                                                 
Ign:20 http://extras.ubuntu.com/ubuntu xenial/main i386 Packages                                                  
Ign:22 http://extras.ubuntu.com/ubuntu xenial/main all Packages                                                   
Ign:23 http://extras.ubuntu.com/ubuntu xenial/main Translation-en_US                                              
Ign:24 http://extras.ubuntu.com/ubuntu xenial/main Translation-en                                                 
Ign:25 http://extras.ubuntu.com/ubuntu xenial/main amd64 DEP-11 Metadata                                          
Ign:26 http://extras.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons                                             
Fetched 204 kB in 12s (16.5 kB/s)                                                                                 
Reading package lists... Done
W: The repository 'http://extras.ubuntu.com/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/xenial/main/source/Sources  404  Not Found [IP: 91.189.92.152 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

不确定问题是什么,但是当我在某处阅读时猜测一些名称冲突 ubuntu 也有一些名为“node”的包,但是需要解决这个问题。

提前致谢。

4

1 回答 1

1

令人惊讶的是,Ubuntu 16.04 是这里唯一的罪魁祸首。

如果您在此处访问 ubuntu 包,看起来 xenial 包不存在。我通过在sources.list 中对此进行评论来解决此问题。

所以这里的修复是:

  1. 打开文件 /etc/apt/sources.list。
  2. 注释所有具有此 url 的行: http: //extras.ubuntu.com/ubuntu

由于这些包不是真正的 ubuntu 源,我们不应该通过注释掉它来产生任何影响。

PS:还在这里创建了一个要点,用于使用 ubuntu 16.04LTS 跟踪此问题。

于 2018-05-19T18:49:55.277 回答