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 1584732 - npm is broken in nodejs:10
Summary: npm is broken in nodejs:10
Keywords:
Status: CLOSED DUPLICATE of bug 1594647
Alias: None
Product: Fedora Modules
Classification: Fedora
Component: nodejs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Hracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-31 14:01 UTC by Stefan Becker
Modified: 2018-08-10 16:48 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-30 11:38:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Stefan Becker 2018-05-31 14:01:25 UTC
I decided to give nodejs:10 a spin on my F28 developer box to test it with my Node.js/npm development project. I get this:

  ## starting point: F28 with working Node.js/NPM development environment:
  $ rpm -q nodejs npm
  nodejs-8.11.2-1.fc28.x86_64
  npm-5.6.0-1.8.11.2.1.fc28.x86_64
  $ rpm -qa "nodejs-*"
  $ echo $NODE_PATH

  $ node --version
  v8.11.2
  $ npm --version
  5.6.0

  ## BTW: The following step is missing in all modularization docs.
  ## Without it none of the "dnf module ..." commands in the docs work :-/
  # dnf install fedora-repos-modular
  ...
  # dnf module install nodejs:10
  ...
  Upgrading        : nodejs-1:10.1.0-3.module_1743+f14d1b86.x86_64          1/4 
  Upgrading        : npm-1:5.6.0-1.10.1.0.3.module_1743+f14d1b86.x86_64     2/4 
  Cleanup          : npm-1:5.6.0-1.8.11.2.1.fc28.x86_64                     3/4 
  Cleanup          : nodejs-1:8.11.2-1.fc28.x86_64                          4/4 
  ...

  $ rpm -q nodejs npm
  nodejs-10.1.0-3.module_1743+f14d1b86.x86_64
  npm-5.6.0-1.10.1.0.3.module_1743+f14d1b86.x86_64
  $ node --version
  v10.1.0
  $ npm --version
  internal/modules/cjs/loader.js:573
      throw err;
      ^
  
  Error: Cannot find module 'readable-stream'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
      at Function.Module._load (internal/modules/cjs/loader.js:497:25)
      at Module.require (internal/modules/cjs/loader.js:626:17)
      at require (internal/modules/cjs/helpers.js:20:18)
      at Object.<anonymous> (/usr/lib/node/.bundled/npm/npmlog/node_modules/are-we-there-yet/tracker-stream.js:3:14)
      at Module._compile (internal/modules/cjs/loader.js:678:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
      at Module.load (internal/modules/cjs/loader.js:589:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
      at Function.Module._load (internal/modules/cjs/loader.js:520:3)
  ...
  $ rpm -ql npm | fgrep /readable-stream
  /usr/lib/node/.bundled/npm/readable-stream
  ...
  /usr/lib/node_modules/npm/node_modules/readable-stream
  $

BTW: using nodejs:10/development doesn't help either.

I guess there is something broken with the bundled modules?

  $ NODE_PATH=/usr/lib/node/.bundled/npm npm --version
  5.6.0

Comment 1 Herbert 2018-07-26 10:09:12 UTC
Had the same problem.
Resolved it by installing nvm and with that installed Node v10.6.0.
After applying this, npm worked again:

# npm -v
6.1.0

Comment 2 Herbert 2018-07-26 20:06:02 UTC
In my post I missed to mention the Node version V10.7.0 causing the problem.

Comment 3 Stephen Gallagher 2018-07-30 11:38:54 UTC

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


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