“在安装NodeJS时出错执行命令,退出错误”。

时间:2022-09-04 23:41:01

I am using Ubuntu 16.04LTS. I typed in the following command in the terminal:

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

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

In return, I am receiving the following error:

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

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

I just installed the very old version of NodeJS and NPM from the Ubuntu repositories because I could not install the most current version. However, I still want the most current version of Node and NPM.

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

1 个解决方案

#1


2  

I had the same issue. The problem is not the nodejs installation script but another package in your package list in /etc/apt/sources.list.

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

The following worked for me:

以下是我的工作经验:

1) Create backup of the file /etc/apt/sources.list just to be on the safe side:

1)创建文件/etc/ apt/sourcesare的备份。为了安全起见,列出以下清单:

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

2) Remove the packages that cause the issue:
Open /etc/apt/sources.list with root permissions, e.g.

2)删除引起问题的包:Open /etc/ apt/sources2。有root权限的列表,例如

sudo nano /etc/apt/sources.list

and remove the

和删除

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

parts. In my case it was skype that caused the issue; you can identify the critical packages by the lines that start with E: Failed to fetch.

部分。就我而言,是skype引起了这个问题;您可以通过以E: Failed to fetch开头的行来识别关键包。

Afterwards, the following works fine (taken from the 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

If one then types

如果一个类型

nodejs -v

it will return

它将返回

v8.9.4

(or whatever version you specified).

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

#1


2  

I had the same issue. The problem is not the nodejs installation script but another package in your package list in /etc/apt/sources.list.

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

The following worked for me:

以下是我的工作经验:

1) Create backup of the file /etc/apt/sources.list just to be on the safe side:

1)创建文件/etc/ apt/sourcesare的备份。为了安全起见,列出以下清单:

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

2) Remove the packages that cause the issue:
Open /etc/apt/sources.list with root permissions, e.g.

2)删除引起问题的包:Open /etc/ apt/sources2。有root权限的列表,例如

sudo nano /etc/apt/sources.list

and remove the

和删除

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

parts. In my case it was skype that caused the issue; you can identify the critical packages by the lines that start with E: Failed to fetch.

部分。就我而言,是skype引起了这个问题;您可以通过以E: Failed to fetch开头的行来识别关键包。

Afterwards, the following works fine (taken from the 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

If one then types

如果一个类型

nodejs -v

it will return

它将返回

v8.9.4

(or whatever version you specified).

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

相关文章