Cannot install the npm package: dependency broken

Bug #1809828 reported by Ra
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
npm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I cannot install the "npm" package on Kubuntu 18.10 (bionic) due to a broken dependency
Here is the log

$ 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.

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic

$ uname -a
Linux raffa-kubuntu 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: npm (not installed)
ProcVersionSignature: Ubuntu 4.18.0-13.14-generic 4.18.17
Uname: Linux 4.18.0-13-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: KDE
Date: Wed Dec 26 22:52:42 2018
InstallationDate: Installed on 2018-11-25 (31 days ago)
InstallationMedia: Kubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.2)
SourcePackage: npm
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ra (raffamaiden) wrote :
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for taking your time to report this issue and help making Ubuntu better.

I was unable to reproduce this issue on my Ubuntu 18.10 system, it installed without issues. Could you please try running `sudo apt update` to refresh the package list before reattempting to run `sudo apt install npm`. If it fails, please add the output from `apt policy npm node-gyp` which will list the available versions of both packages. That might tell us what's wrong.

Changed in npm (Ubuntu):
status: New → Incomplete
tags: added: unmetdeps
Revision history for this message
Ra (raffamaiden) wrote :

I was able to install it following the instructions I found here: https://askubuntu.com/questions/899756/cant-install-npm-unable-to-correct-problems-you-have-held-broken-packages

That is, I run

sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm

in that order and it installed correctly.
I am now unable to reproduce it too. Even after reverting the instructions I followed, npm installs correctly. I did

sudo apt remove --purge --assume-yes npm
sudo apt remove --purge --assume-yes node-gyp
sudo apt remove --purge --assume-yes nodejs-dev
sudo apt remove --purge --assume-yes libssl1.0-dev
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get install -f
sudo apt-get --assume-yes autoremove

and then `sudo apt-get install npm` successfully installed it

Revision history for this message
Tom Reynolds (tomreyn) wrote :

This issue also affects 18.04.1.

$ lsb_release -ds; cat /proc/version; cat /proc/cmdline
Ubuntu 18.04.1 LTS
Linux version 4.18.0-13-generic (buildd@lcy01-amd64-024) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #14~18.04.1-Ubuntu SMP Thu Dec 6 14:09:52 UTC 2018
BOOT_IMAGE=/vmlinuz-4.18.0-13-generic root=/dev/mapper/vg-slash ro

$ apt-cache policy npm node-gyp
npm:
  Installed: (none)
  Candidate: 3.5.2-0ubuntu4
  Version table:
     3.5.2-0ubuntu4 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe i386 Packages
node-gyp:
  Installed: (none)
  Candidate: 3.6.2-1ubuntu1
  Version table:
     3.6.2-1ubuntu1 500
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        500 http://de.archive.ubuntu.com/ubuntu bionic/universe i386 Packages

$ sudo apt-get update -qq && 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.

I do have some third party repos installed, but I don't think they are getting in the way (as the apt-cache policy <packagename> outputs above seem to confirm). Please find my full "apt-cache policy" output attached.

Changed in npm (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Tom Reynolds (tomreyn) wrote :
Revision history for this message
lotuspsychje (lotuspsychje) wrote :

I tested this on 18.04.1 up to date to latest @ 19/1/2019

npm installs without problems here, node-gyp is marked for install aswell

Revision history for this message
Esko Järnfors (esko-jarnfors) wrote :

Here's the rabbit hole I went down:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

# 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.

# apt-get install node-gyp
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:
 node-gyp : Depends: nodejs-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

# apt-get install nodejs-dev
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:
 nodejs-dev : Depends: libssl1.0-dev (>= 1.0.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

# apt-get install libssl1.0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libcurl4-openssl-dev libssl-dev
The following NEW packages will be installed:
  libssl1.0-dev
0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 1,365 kB of archives.
After this operation, 1,997 kB disk space will be freed.
Do you want to continue? [Y/n]

So the packages blocking npm from installing are libssl-dev and libcurl4-openssl-dev. Some node stuff is apparently depending on old openssl.

Revision history for this message
Launo Tuuri (ltuuri) wrote :

So apt is suggesting to give up current ssl-dev for a very old ssl-dev? Not cool :-/

Revision history for this message
Esko Järnfors (esko-jarnfors) wrote :

#1799261 is basically the same issue.

Revision history for this message
Kolargol00 (kolargol00) wrote :

This happens because nodejs in bionic is linked against OpenSSL 1.0 (see #1779863) while most other packages in bionic use OpenSSL 1.1. Installing any package using OpenSSL 1.1 will conflict with nodejs (more exactly: any package depending on libssl-dev, which conflicts with libssl1.0-dev).

As Esko noted, bionic has some other packages conflicting because of this OpenSSL 1.0+1.1 mix.

Revision history for this message
Vincent Gerris (vgerris) wrote :

I still have this issue with the most recent updates on Ubuntu 18.04.
Also reported here:
https://askubuntu.com/questions/1088662/npm-depends-node-gyp-0-10-9-but-it-is-not-going-to-be-installed

this bug is related to it:
https://bugs.launchpad.net/ubuntu/+source/npm/+bug/1517491

Revision history for this message
Hakim Benoudjit (h4k1m0u) wrote :

For me (on bionic) the conflict seems to be against `libgdal-dev` and other libraries installed from ubuntugis/stable repo when I compiled GrassGIS from source.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.