T
T
ton1_rose2017-05-14 14:57:17
SSH
ton1_rose, 2017-05-14 14:57:17

Trouble installing npm?

Guys, problem with npm installation. trying to install on VPS under Ubuntu 16.04.2
sudo apt-get install npm

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

In this case, the response says that some packages cannot be installed and the following packages have unmet dependencies:
npm : Depends: node-gyp (>= 0.10.9)
Unable to fix problems, you have broken packages.
When installing node-gyp o5 sequentially, I get a message that you have broken packages.
The following packages have unmet dependencies:
 node-gyp : Depends: nodejs-dev but it is not going to be installed
            Recommends: build-essential but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

In many guides, it is proposed to execute a number of commands, which should subsequently fix the problem.
similar to this
When executing sudo apt-get update , the following lines appear at the end of execution
Reading package lists... Done
W: The repository 'http://old-releases.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.
W: The repository 'http://old-releases.ubuntu.com/ubuntu xenial-updates 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://old-releases.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

sudo apt-get dist-upgrade didn't solve the problem either.
It turns out that the problem is with dependencies. I've been suffering for a long time.
As I understand it, one of the /etc/apt/sources.list files needs to be edited,
but I don’t understand what exactly needs to be replaced there. please help with a solution.
nodejs -v
v0.10.25

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dark Hole, 2017-05-14
@abyrkov

NPM comes with Node.js. Problems due to the fact that the new version of Node.js (either 7.х.х, or 6.х.х) conflicts with the old one and Node cannot be updated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question