Description of problem: npm doesn't work Version-Release number of selected component (if applicable): npm-6.1.0-1.10.5.0.1.fc29.x86_64 How reproducible: easily Steps to Reproduce: 1. npm --version Actual results: internal/modules/cjs/loader.js:596 throw err; ^ Error: Cannot find module 'are-we-there-yet' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/usr/lib/node/.bundled/npm/npmlog/log.js:2:16) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) Expected results: a version number Additional info: The are-we-there-yet module is indeed bundled inside the npm package: # ls -l /usr/lib/node_modules/npm/node_modules/are-we-there-yet lrwxrwxrwx. 1 root root 43 Jun 23 02:02 /usr/lib/node_modules/npm/node_modules/are-we-there-yet -> ../../../node/.bundled/npm/are-we-there-yet # ls -l /usr/lib/node/.bundled/npm/are-we-there-yet/ total 40 -rw-r--r--. 1 root root 1107 Jun 23 01:16 CHANGES.md -rw-r--r--. 1 root root 163 Jun 23 01:16 index.js -rw-r--r--. 1 root root 733 Jun 23 01:16 LICENSE -rw-r--r--. 1 root root 1661 Jun 23 01:16 package.json -rw-r--r--. 1 root root 6300 Jun 23 01:16 README.md -rw-r--r--. 1 root root 274 Jun 23 01:16 tracker-base.js -rw-r--r--. 1 root root 3231 Jun 23 01:16 tracker-group.js -rw-r--r--. 1 root root 826 Jun 23 01:16 tracker.js -rw-r--r--. 1 root root 943 Jun 23 01:16 tracker-stream.js But comparing with nodejs-8.11.3-1.fc27 I see that the layout of the bundled modules on disk has changed. Maybe that is the cause of this problem? I note the stack trace shows that it *did* successfully load the bundled npmlog module, but then its dependency has failed to load from the same place.
FYI Koschei told me about this: https://apps.fedoraproject.org/koschei/package/nodejs-normalize-path?collection=f29 https://kojipkgs.fedoraproject.org/work/tasks/9553/27789553/build.log I expect it broke a lot of (all?) nodejs packages.
*** Bug 1596912 has been marked as a duplicate of this bug. ***
I've been looking into this today. What happened is that npm flattened its bundling structure such that all of its dependencies are stored at the top of its node_module hierarchy, rather than having each dependency bundle their own underneath. On the one hand, this is good as it means that there's less risk of carrying differing versions throughout the project. On the other hand, it causes import issues if the directories are symlinked. There's an argument to the node application to work around this, --preserve-symlinks, but a search of the web implies that this may introduce a bunch of risky edge-cases, so we don't want to do that. The most direct solution would be to abandon any hope of ever debundling NPM and ridding ourselves of the symlinked directories. This would require following https://fedoraproject.org/wiki/Packaging:Directory_Replacement#Scriptlet_to_replace_a_symlink_to_a_directory_with_a_directory for all of the (many) symlinked directories in Node.js I'm going to be away on PTO this coming week, so if someone else wants to pick up from where I've left off, I'd appreciate it.
I've got a fix for this coming along. It will be part of the 10.7.0 release I'll have out later tonight. Sorry this has dragged on for so long.
10.7.0-2.fc29.1 seems broken: Problem 1: cannot install the best update candidate for package npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 - nothing provides nodejs = 1:10.7.0-2.fc29 needed by npm-1:6.1.0-1.10.7.0.2.fc29.1.x86_64 Problem 2: problem with installed package npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 - package npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 requires nodejs = 1:10.5.0-1.fc29, but none of the providers can be installed - nodejs-1:10.5.0-1.fc29.i686 has inferior architecture - cannot install both nodejs-1:10.7.0-2.fc29.1.x86_64 and nodejs-1:10.5.0-1.fc29.x86_64 - cannot install the best update candidate for package nodejs-1:10.5.0-1.fc29.x86_64 - nothing provides nodejs = 1:10.7.0-2.fc29 needed by npm-1:6.1.0-1.10.7.0.2.fc29.1.x86_64 (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages) Looks like the requires in npm is missing the .1 at the end: Requires: nodejs = %{epoch}:%{nodejs_version}-%{nodejs_release}%{?dist}.1 ^^
(In reply to Sandro Mani from comment #5) > 10.7.0-2.fc29.1 seems broken: > > Problem 1: cannot install the best update candidate for package > npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 > - nothing provides nodejs = 1:10.7.0-2.fc29 needed by > npm-1:6.1.0-1.10.7.0.2.fc29.1.x86_64 > Problem 2: problem with installed package npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 > - package npm-1:6.1.0-1.10.5.0.1.fc29.x86_64 requires nodejs = > 1:10.5.0-1.fc29, but none of the providers can be installed > - nodejs-1:10.5.0-1.fc29.i686 has inferior architecture > - cannot install both nodejs-1:10.7.0-2.fc29.1.x86_64 and > nodejs-1:10.5.0-1.fc29.x86_64 > - cannot install the best update candidate for package > nodejs-1:10.5.0-1.fc29.x86_64 > - nothing provides nodejs = 1:10.7.0-2.fc29 needed by > npm-1:6.1.0-1.10.7.0.2.fc29.1.x86_64 > (try to add '--allowerasing' to command line to replace conflicting packages > or '--skip-broken' to skip uninstallable packages) > > Looks like the requires in npm is missing the .1 at the end: > > Requires: nodejs = %{epoch}:%{nodejs_version}-%{nodejs_release}%{?dist}.1 > ^^ yeah, that .1 is a mistake. I removed it at least once and then a bad merge from the "10" branch brought it back again. *sigh* I'll fix that today when I build -3 to fix an annobin issue as well. FWIW, the module stream version shouldn't have this problem, so if you want to test with that, install fedora-repos-modular and do `dnf module install nodejs:10`
*** Bug 1584732 has been marked as a duplicate of this bug. ***
nodejs-10-20180720171652.9c690d0e has been submitted as an update to Fedora 28 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2018-4058b2f0fb
This *should* be fixed in Rawhide at this point (and fixes for the Modular repo are in the queue). Please confirm.
Working fine as far as I can see here, thanks.
nodejs-10-20180720171652.9c690d0e has been pushed to the Fedora 28 Modular testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2018-4058b2f0fb
nodejs-10-20180720171652.9c690d0e has been pushed to the Fedora 28 Modular stable repository. If problems still persist, please make note of it in this bug report.