【问题标题】:"Error Executing Command, Exiting" Error upon installation of NodeJS安装 NodeJS 时出现“执行命令时出错,退出”错误
【发布时间】:2018-02-08 17:17:13
【问题描述】:

我使用的是 Ubuntu 16.04LTS。 我在终端中输入了以下命令:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

作为回报,我收到以下错误:

Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/tualatrix/next/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.
W: The repository 'http://ppa.launchpad.net/tualatrix/ppa/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://ppa.launchpad.net/tualatrix/next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting

我刚刚从 Ubuntu 存储库安装了非常旧版本的 NodeJS 和 NPM,因为我无法安装最新版本。但是,我仍然想要最新版本的 Node 和 NPM。

【问题讨论】:

  • npm i -g npm 更新 npm。对于节点检查n
  • 在运行命令之前你是否已经用sudo apt update更新了你的包列表?
  • 是的,我做到了。我执行了更新
  • 我认为你的问题不是来自节点安装程序,而是你的包列表中的一个错误包:似乎是包http://ppa.launchpad.net/tualatrix/next/ubuntu
  • 如何删除它?

标签: node.js ubuntu-16.04


【解决方案1】:

我有同样的问题。问题不在于nodejs 安装脚本,而在于/etc/apt/sources.list 中的包列表中的另一个包。

以下内容对我有用:

1) 为安全起见创建文件/etc/apt/sources.list 的备份:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bu

2) 删除导致问题的软件包:
以root权限打开/etc/apt/sources.list,例如

sudo nano /etc/apt/sources.list

并删除

http://ppa.launchpad.net/tualatrix/next/ubuntu/dists/xenial/main/binary-amd64/Packages

零件。就我而言,是 Skype 导致了这个问题。您可以通过以E: Failed to fetch 开头的行来识别关键包。

之后,以下工作正常(取自installation instructions):

cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
sudo apt-get install build-essential

如果有则输入

nodejs -v

它会返回

v8.9.4

(或您指定的任何版本)。

如果您已经安装了anaconda,我建议将node.js 安装在一个保持清洁的环境中。可以在here 找到有关如何执行此操作的详细说明。基本上它所需要的就是

conda create -n webdev nodejs

加上所需的python模块,以防您想使用例如FlaskDjango

【讨论】:

    最近更新 更多