Cli: [BUG] npm install or npm update sometimes trashes lockfile, setting `resolved: false`

Created on 10 Apr 2020  路  2Comments  路  Source: npm/cli

Note: I am porting this issue over from the now archived npm.community with the hopes that this issue can get escalated and resolved as it looks like it has been largely overlooked up to this point. Maybe this issue can be set to resolved: true 馃槈


What / Why

  • My package-lock.json constantly toggles between:
 "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz",
  "resolved": false,

When

  • n/a

Where

  • n/a

How

Current Behavior

  • Running npm install or npm update sometimes trashes the lockfile, setting resolved: false for a number of packages.

Steps to Reproduce

  • Run npm install or npm update
  • Check package-lock.json for changes

Expected Behavior

  • resolve does not switch between false and the URL.

Who

  • n/a

References

Bug

Most helpful comment

We've been encountering this quite frequently in WordPress/gutenberg lately.

Some possibly relevant additional details:

  • The packages which fluctuate are often "optional": true, or transitive dependencies of an "optional": true (e.g. nopt, node-pre-gyp, fsevents).
  • Our project is structured as a monorepository, with many dependencies in package.json defined as local filesystem dependencies.

All 2 comments

We've been encountering this quite frequently in WordPress/gutenberg lately.

Some possibly relevant additional details:

  • The packages which fluctuate are often "optional": true, or transitive dependencies of an "optional": true (e.g. nopt, node-pre-gyp, fsevents).
  • Our project is structured as a monorepository, with many dependencies in package.json defined as local filesystem dependencies.

For anyone else encountering this problem: rm -rf node_modules/ && npm cache clean --force && npm install helped in my case.

Was this page helpful?
0 / 5 - 0 ratings