The package-lock.json file contains lines of the form https://github.com/RocketChat/Rocket.Chat/blob/f2f73afa480808af2a3a352c3ffd194047e25f5f/package-lock.json#L2991-L2995
Where the resolved field doesn't actually point to the resolved URI, but is just false. This prevents certain tools, such as node2nix in my case, from being able to use the lock file to fully resolve dependencies.
I found this issue which mentions such a problem: https://npm.community/t/npm-install-or-npm-update-turns-a-bunch-of-resolved-in-package-lock-json-from-real-values-to-false/3308, but without any good solutions other than rm -rf node_modules && npm install.
It would be great if this problem could at least be temporarily fixed on the 2.0.0 release branch.
package-lock.json should point all resolved fields to URI's
Some URI's are false
For now I was able to write a hacky jq script to fix it:
cat package-lock.json | jq 'walk(if type == "object" then with_entries(if (.value | type) == "object" and .value.resolved == false then .value.resolved = "https://registry.npmjs.org/\(.key)/-/\(.key)-\(.value.version).tgz" else . end) else . end)' > package-lock-new.json
FWIW: There are some other people reporting this behaviour, e.g.
https://npm.community/t/npm-install-or-npm-update-turns-a-bunch-of-resolved-in-package-lock-json-from-real-values-to-false/3308
or
https://npm.community/t/constant-resolved-false-toggle/276
Is there an explanation about why this is happening ?
At least two people (probably more) in my team are seeing this. We've been on npm 6.13.4 for a while, and have started seeing false values appearing in the last few weeks I think (for me, it started today).
For me, removing node_modules isn't helping. The package.json file in the one package I looked at had a URL for _resolved, not false.
I've never used npm link.
Oops. This isn't the npm project. Oh well.
I've never used RocketChat.
there are no more "resolved": false but if that happens to some of you, you can try the following https://github.com/npm/npm/issues/20106#issuecomment-383770315
Most helpful comment
Is there an explanation about why this is happening ?