npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm ci fails due to a missing file

What I Wanted to Do

Trying to use “npm ci --only=production”

What Happened Instead

I get a the following error message:

npm ERR! path /Users/stuart/git/npm-eslint/node_modules/eslint/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/stuart/git/npm-eslint/node_modules/eslint/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/stuart/.npm/_logs/2018-05-25T19_42_42_984Z-debug.log

Reproduction Steps

To reproduce, put the linked package.json in a new directory:

Then do the following:

npm install
rm -rf node_modules
npm ci --only=production 
// Edit by @zkat: this crash *only* happens with `--only=production`

Details

Versions:

6.0.1

// Edit by @zkat: I've confirmed the bug in these versions as well
6.1.0
6.1.0-canary.5 

Error log is at: https://gist.github.com/morungos/f216304a9c627d0c2aa7bc0f9729aa36


I believe this is related to https://github.com/zkat/cipm/issues/48, which is a known issue with how libcipm handles prod/dev deps.


Hey, we are also facing this bug.
Need to install production only for our bundle creation on the build server.
Is there any progress in this to fix it or is there a workaround?