-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Question / Help]: How can we make sure if version in package-lock satisfies the version mentioned in package.json ? #1558
Comments
|
@ljharb Thank you, Correct me if i'm wrong, Case 1: Case 2: Case 3: I can run all these use cases in local 👍 . Just calling it out here to get your opinion. |
In case 1, yes, it will error. In case 2, it will also error because it requires node_modules to be present. In case 3, yes, it will also identify it, because when a lockfile is present, it largely ignores package.json. |
@ljharb Thank you once again. 👍 . Can we somehow validate what npm ls does without needing node_modules ? I'm asking this because let say if we are implementing CI / CD for nodejs application. Running If there is no way to validate without node_modules. Can we have feature like that ? Is it worth for the community ? |
You always need node_modules. Since you need them installed for any meaningful CI also, i don’t see why it adds time. |
@sathishsoundharajan Assuming your CI/CD setup needs to install dependencies at some point in its workflow (would be weird if it didn't), you might want to run |
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
How can we make sure if version in package-lock satisfies the version mentioned in package.json ? Ideally i'm looking at validating this as part of the pre-commit hook.
We have kind of mixed dependencies some public npm packages and some provide packages hosted by github / gitlab / bitbucket, referencing them directly with tag in package.json
I was previously thinking about using the lock-verify, but still would the solve the problem, because it seems lock-verify won't validate anything which requires network connection & also that is being depreciated now.
Refs:
https://stackoverflow.com/questions/45287398/is-there-a-way-to-confirm-a-package-lock-json-actually-resolves-all-dependencies
https://www.npmjs.com/package/lock-verify
The text was updated successfully, but these errors were encountered: