Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1637701

Summary: Impossible to switch streams from nodejs:10 to nodejs:8
Product: [Fedora] Fedora Reporter: Petr Šabata <psabata>
Component: nodejsAssignee: Stephen Gallagher <sgallagh>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: giampaolo.ferradini, mrunge, nodejs-sig, nphilipp, sgallagh, tchollingsworth, thrcka, 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: 2018-10-11 16:29:07 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:
Bug Depends On: 1594647    
Bug Blocks:    

Description Petr Šabata 2018-10-09 19:53:40 UTC
Description of problem:
Trying to downgrade to nodejs:8 from modular nodejs:10 blows up.

Version-Release number of selected component (if applicable):
nodejs:10:20180920144631
nodejs:8:20180816123422

How reproducible:
Always.

Steps to Reproduce:
1. dnf module install nodejs:10
2. dnf module install nodejs:8 OR dnf module enable nodejs:8 && dnf distro-sync

Actual results:
Installation fails on many, many file conflicts, e.g.:

Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction check error:
  file /usr/lib/node_modules/npm/node_modules/JSONStream from install of npm-1:5.6.0-1.8.11.4.1.module_2030+281d4413.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.1.module_2200+36094b1f.x86_64
  file /usr/lib/node_modules/npm/node_modules/abbrev from install of npm-1:5.6.0-1.8.11.4.1.module_2030+281d4413.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.1.module_2200+36094b1f.x86_64
  file /usr/lib/node_modules/npm/node_modules/ansi-regex from install of npm-1:5.6.0-1.8.11.4.1.module_2030+281d4413.x86_64 conflicts with file from package npm-1:6.4.1-1.10.11.0.1.module_2200+36094b1f.x86_64
(...)

Expected results:
My system downgrades nodejs to nodejs:8 packages.

Additional info:
This might not be possible to fix due to changes in nodejs packaging.
But let's check.

Comment 1 Stephen Gallagher 2018-10-11 16:29:07 UTC
Unfortunately, we can't make this work. Between Node.js 8 and Node.js 10, the packaging of the bundled NPM changed significantly and required us to replace a whole lot of symlinks with a real directory. See https://bugzilla.redhat.com/show_bug.cgi?id=1594647 for all the gory details.

Because of limitations in RPM, we can't downgrade back to the older version without considerable hacking around in pre- and post- scripts.

Comment 2 Stephen Gallagher 2018-10-12 13:14:13 UTC
*** Bug 1638778 has been marked as a duplicate of this bug. ***

Comment 3 Stephen Gallagher 2018-10-12 13:16:10 UTC
For the record, the workaround here is to completely remove the nodejs RPM from the system before switching streams and then reinstall it.

Comment 4 giampaolo ferradini 2020-08-11 21:34:31 UTC
(In reply to Stephen Gallagher from comment #3)
> For the record, the workaround here is to completely remove the nodejs RPM
> from the system before switching streams and then reinstall it.

I would assume this bug is still floating around, correct? At least I can report a behaviour similar to the one reported in bug 1638778 (the duplicate mentioned above).
My problem is: these messages appeared after a `# dnf remove nodejs npm` and a reinstall. Is there additional steps required to 'completely' remove it?

Cheers!

Comment 5 giampaolo ferradini 2020-08-11 22:40:59 UTC
Edit, and solution for the records: I installed nvm from source (i.e. from https://github.com/nvm-sh/nvm#install--update-script ) and then installed through nvm itself (`nvm install --lts`, no need to pick the stable long term version, just a personal choice.)
`dnf` had removed some stuff, so that checking `node -v` would return `command not found`, and then nvm took care of the rest.