npm install failts with --prefix flag

What I Wanted to Do

Run npm install in project root and specify directory that contains FE project with package.json using --prefix flag

What Happened Instead

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

Reproduction Steps

cd one directory up
run npm install --prefix [name of your dir with package.json]

Details

Issue was noticed in TraviCI first, was able to reproduce locally

Platform Info

$ npm --versions
{ npm: '6.7.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.10.0',
  openssl: '1.1.1a',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.26.0',
  v8: '7.0.276.38-node.17',
  zlib: '1.2.11' }
$ node -p process.platform
darwin

2019-02-20T18_26_59_076Z-debug.log (745.1 KB)

I can’t reproduce this with the information that your provided. Do you have a more detailed debug log? Also, there’s probably an Unhandled rejection. Because those aren’t in the debug log can you attach that too?

I have attached debug log, not sure where i can get info about unhanded rejection

there was one error about files not found in /node_modules/.staging/, but I can’t find it now

UPDATE: actually that error is in the debug log :slight_smile:

1 Like

Hmm actually it looks like there are inconsistencies with package-lock.json and react-scripts’ package dependencies, seems like issue with lock file created in MacOS vs Ubuntu vs Arch. Lock file created in one system causes npm install to fail in other systems

EDIT: Which means that issue is not with --prefix flag and we can probably close this bug report

Well, I’m still interested in this part, because that shouldn’t happen AFAIK (other than integrity issues for non-registry deps perhaps).

Well, there are so many variables, I’m not even sure how to provide the steps for replication and which vars matter.

I’m working on react app that was created with create-react-app.

Issue first surfaces when I was trying to create package-lock.json on Darwin (saw a couple warnings with fsevents) but uploading this lock file to Debian caused npm install to overwrite this lock file causing git issues with CI/CD (local changes exist). Second attempt was to generate package-lock.json file on Arch (another work machine), the lock file created on arch was different from the one on Darwin but it caused the error above on Darwin and apparently in Debian VM in TravisCI.

All machines, VMs and CI/CD boxes are running node v11.10.0 and npm v6.7.0

Interesting point about non-registry deps, I do have those, but diff for lock files on different systems weren’t particularly about non-registry dependencies but rather random (I didn’t notice any specific patterns)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.