Bug 1339284

Summary: npm install fails; cannot resolve nodejs(engine)
Product: [Fedora] Fedora Reporter: Jon Orris <jorris>
Component: npmAssignee: T.C. Hollingsworth <tchollingsworth>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: ffranz, jamielinux, kae, lmacken, marseille07, mike, msrb, ncross, paulo.fidalgo.pt, rdieter, tchollingsworth, tmlcoch, tom, zsvetlik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-09 06:47:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jon Orris 2016-05-24 14:42:10 UTC
Description of problem:

npm does not install in latest Fedora 24 due to missing dependency.

$ dnf install npm

Error: package npm-3.5.4-5.fc24.noarch requires nodejs(engine), but none of the providers can be installed

Comment 1 Mike Goodwin 2016-06-14 15:36:53 UTC
I can confirm this, it's causing my F24 COPR builds to fail, too.

$ sudo dnf repoquery --provides nodejs | grep engine
nodejs(engine) = 4.4.5
$ sudo dnf repoquery --requires npm | grep engine
nodejs(engine)

Comment 2 Rex Dieter 2016-06-14 15:38:35 UTC
I can reproduce this too, though interestingly :

dnf install 'nodejs(engine)' 

works.

Comment 3 Jon Orris 2016-06-14 18:55:44 UTC
Yes, it does. 

=====================================================================================
 Package          Arch             Version                    Repository        Size
=====================================================================================
Installing:
 libuv            x86_64           1:1.7.5-2.fc24             fedora            78 k
 nodejs           x86_64           1:4.4.5-1.fc24             fedora           5.9 M
...
Installed:
  libuv.x86_64 1:1.7.5-2.fc24              nodejs.x86_64 1:4.4.5-1.fc24             

Then more interestingly, npm install fails differently:
$ sudo dnf install npm
Error: installed package nodejs-1:4.4.5-1.fc24.x86_64 obsoletes npm < 3.5.4-6 provided by npm-3.5.4-5.fc24.noarch
(try to add '--allowerasing' to command line to replace conflicting packages)

Comment 4 Rex Dieter 2016-06-14 19:12:40 UTC
Ah, so nodejs currently Obsoletes:  the latest available npm.  Seems we need a newer npm build (or the Obsoletes relaxed)

Comment 5 Zuzana Svetlikova 2016-06-15 06:46:49 UTC
Nodejs package shipped in f24 also provides npm, both in LTS versions instead of latest, but the npm package is still in the repositories, which causes confusion (and errors).

Comment 6 Paulo Fidalgo 2016-06-23 18:16:25 UTC
This is making upgrading to FC24 impossible:

sudo dnf system-upgrade download --refresh --releasever=24 
RPM Fusion for Fedora 24 - Nonfree                                                                                          2.5 kB/s | 419  B     00:00    
google-chrome                                                                                                               1.9 kB/s | 3.5 kB     00:01    
RPM Fusion for Fedora 24 - Free - Updates                                                                                   619 kB/s | 242 kB     00:00    
RPM Fusion for Fedora 24 - Free                                                                                             1.7 kB/s | 413  B     00:00    
Copr repo for atom owned by mosquito                                                                                        332 kB/s | 1.3 MB     00:03    
Failed to synchronize cache for repo 'rpmfusion-nonfree-updates', disabling.
Last metadata expiration check: 0:00:01 ago on Thu Jun 23 19:14:19 2016.
Error: package nodejs-1:4.4.5-1.fc24.x86_64 obsoletes npm < 3.5.4-6 provided by npm-3.5.4-5.fc24.noarch
(try to add '--allowerasing' to command line to replace conflicting packages)


Also if I add '--allowerasing' I cannot proceed:

sudo dnf system-upgrade download --refresh --releasever=24 --allowerasing
RPM Fusion for Fedora 24 - Nonfree                                                                                          1.8 kB/s | 419  B     00:00    
RPM Fusion for Fedora 24 - Free - Updates                                                                                   634 kB/s | 242 kB     00:00    
RPM Fusion for Fedora 24 - Free                                                                                             2.7 kB/s | 413  B     00:00    
google-chrome                                                                                                               1.6 kB/s | 3.5 kB     00:02    
Copr repo for atom owned by mosquito                                                                                        318 kB/s | 1.3 MB     00:04    
Failed to synchronize cache for repo 'rpmfusion-nonfree-updates', disabling.
Last metadata expiration check: 0:00:02 ago on Thu Jun 23 19:15:19 2016.
Dependencies resolved.
Error: The operation would result in removing the booted kernel: kernel-core-4.5.7-200.fc23.x86_64.

Comment 7 kae verens 2016-06-28 08:39:47 UTC
I just came across the same problem.

however, it seems that the npm command is installed as part of the nodejs package, even though I have not managed to install the npm package.

maybe the real bug here is that there is an npm package that is obsolete?

Comment 8 Nick Cross 2016-07-07 14:43:05 UTC
Is this related to bug 1351007?

Comment 9 Satoshi Yagi 2016-07-08 23:24:09 UTC
>maybe the real bug here is that there is an npm package that is obsolete?

It seems that way.  Looking at which packages provide npm:

$ npm
bash: npm: command not found...
Packages providing this file are:
'nodejs'
'npm'

I'm not sure when nodejs RPM started providing the npm commandline, but it seems to do so now.  In which case, we can simply yank out the npm package and everything works just fine.

If the direction is to go back to the previous way, where nodejs provides just nodejs and npm rpm providing the npm commandline, then nodejs rpm needs to be repackaged without npm bundled.

Comment 10 Tom Hughes 2016-07-09 06:47:25 UTC

*** This bug has been marked as a duplicate of bug 1351007 ***