Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for outdated package-lock.json #62

Closed
Sinclert opened this issue Feb 19, 2022 · 1 comment
Closed

Check for outdated package-lock.json #62

Sinclert opened this issue Feb 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Sinclert
Copy link
Member

There are cases where an outdated package-lock.json could be mistakenly pushed, making GitHub Actions CI to successfully run the validations, while our local environment fails.

This may happen while debugging, as different versions of the package.json specified packages could be installed locally (therefore updating both package.json and package-lock.json files), before manually changing package.json back to its original specification.

The script could rely on:

@Sinclert Sinclert added the enhancement New feature or request label Feb 19, 2022
@Sinclert
Copy link
Member Author

Turns out checking for the package-lock.json file to be out of sync with respect to the package.json is something already promised for the npm ci command to do:

If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.

However, npm ci versions 7 and 8 (prior to 8.4.1) contain a bug so that package-lock.json inconsistencies are not properly alert about. More information can be found in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant