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 1594647 - npm Error: Cannot find module 'are-we-there-yet'
Summary: npm Error: Cannot find module 'are-we-there-yet'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nodejs
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: NodeJS Packaging SIG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1584732 1596912 (view as bug list)
Depends On:
Blocks: 1604516 1604996 1637701
TreeView+ depends on / blocked
 
Reported: 2018-06-25 05:41 UTC by Dan Callaghan
Modified: 2018-10-11 16:29 UTC (History)
12 users (show)

Fixed In Version: nodejs-10-20180720171652.9c690d0e
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-08 16:44:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2018-06-25 05:41:49 UTC
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.

Comment 1 Dan Callaghan 2018-06-25 05:42:41 UTC
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.

Comment 2 Stephen Gallagher 2018-07-06 17:24:13 UTC
*** Bug 1596912 has been marked as a duplicate of this bug. ***

Comment 3 Stephen Gallagher 2018-07-06 17:43:34 UTC
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.

Comment 4 Stephen Gallagher 2018-07-20 00:26:52 UTC
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.

Comment 5 Sandro Mani 2018-07-20 12:17:45 UTC
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
                                                                       ^^

Comment 6 Stephen Gallagher 2018-07-20 13:00:22 UTC
(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`

Comment 7 Stephen Gallagher 2018-07-30 11:38:54 UTC
*** Bug 1584732 has been marked as a duplicate of this bug. ***

Comment 8 Fedora Update System 2018-07-30 11:41:04 UTC
nodejs-10-20180720171652.9c690d0e has been submitted as an update to Fedora 28 Modular. https://bodhi.fedoraproject.org/updates/FEDORA-MODULAR-2018-4058b2f0fb

Comment 9 Stephen Gallagher 2018-07-30 11:42:39 UTC
This *should* be fixed in Rawhide at this point (and fixes for the Modular repo are in the queue). Please confirm.

Comment 10 Sandro Mani 2018-07-30 11:43:30 UTC
Working fine as far as I can see here, thanks.

Comment 11 Fedora Update System 2018-07-30 15:15:20 UTC
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

Comment 12 Fedora Update System 2018-08-08 16:44:40 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.