You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR modifies the package-lock.json file to the new v2 format which was rolled out with npm v7 back in 10/2020. This is supposed to be better able to give deterministic build results with regards to tree shape. The new lockfile is backwards compatible with npm v6 (which comes with node 14 on some platforms like GH actions), but it's expected that most people will be trending forward to newer versions of npm (which is at v9), that most people won't need to worry about the compatibility.
Checklist
Please review this checklist before submitting a pull request.
QQ: will this format be respected by default when someone adds a new package with npm install? Can you also mention the command used to move to the new format for posterity?
If someone uses npm v7+, then the format of the lockfile will remain v2.
If someone uses npm v6, then the format of the lockfile will be downgraded to v1. This is the thing we'd want to watch out for in someone submitting a PR that modifies dependencies.
Moving between the versions is done as part of the regular npm install usage, and I "upgraded" the package-lock.json by doing npm install, though if you wanted to fully replicate my process, you could do npx npm@8 install
To know what version the lockfile is at, there's a lockfileVersion field that is at the top of the file that designates the version, where if that's missing, then it was made using npm v5 or lower, if it's 1, then that's npm 6 and 2 or higher is npm v7+. If we wanted to totally break allowing people with older versions of npm, the version could be set to 3, but there's not a huge gain there, and again, in my experience most people are already using a newer version of npm anyway, and I've not seen issues of package-lock versioning once upgraded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please explain the changes you made here.
PR modifies the
package-lock.jsonfile to the new v2 format which was rolled out with npm v7 back in 10/2020. This is supposed to be better able to give deterministic build results with regards to tree shape. The new lockfile is backwards compatible with npm v6 (which comes with node 14 on some platforms like GH actions), but it's expected that most people will be trending forward to newer versions of npm (which is at v9), that most people won't need to worry about the compatibility.Checklist
Please review this checklist before submitting a pull request.
npm run test:all)