reinstall breaks after npm update to 6.10.2

What I Wanted to Do

After updating npm to 6.10.2, I observed the package-lock.json generated for local dependencies defer from the one created by 6.10.1 which, unfortunately, breaks the package install on running npm install again.

  • I updated to 6.10.2
  • Ran npm install (which created a package-lock.json)
  • Added a new package
  • on a different system ran npm install with the same package-lock.json and updated npm 6.10.2

What Happened Instead

The installation fails.

Reproduction Steps

clone the repo https://github.com/chhetrisushil/npm-update-test

  • I updated to 6.10.2
  • Ran npm install (which created a package-lock.json)
  • Added a new package
  • on a different system ran npm install with the same package-lock.json and updated npm 6.10.2

Details

Platform Info

$ npm --versions
npm: 6.10.2
$ node -p process.platform
platform: darwin (MacOS Mojave)

Seemed familiar, looks similar to older (pre 6.10.2) issue:

Yes, seems to have resurfaced in 6.10.2.

Can you try this and see if it fixes the problem?

npm i -g "salomvary/npm-cli#fix-multimodule-local"

If it does, then I think landing https://github.com/npm/cli/pull/217 (or something like it) will fix the problem. I still need to bisect into the history and see exactly why this fixes it, if it does. It’s a dense part of the codebase, sorry for the delay.

Thanks.


EDIT: Ok, scratch that. It does. It got some time to review this more thoroughly today, and the fix will be in the next release. That’ll be either 6.10.4 or 6.11.0, depending on whether I can finish and land peerDependenciesMeta, which would be a semver-minor.

1 Like