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

npm i --package-lock-only breaks lockfile when file: references present #2388

Closed
rarkins opened this issue Aug 15, 2018 · 8 comments
Closed
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:blocked Issue is blocked by another issue or external requirement

Comments

@rarkins
Copy link
Collaborator

rarkins commented Aug 15, 2018

As mentioned in #2294, the package-lock.json we're creating is wrong sometimes, seemingly due to a bug in npm.

npm reference: https://npm.community/t/npm-i-package-lock-only-changes-lock-file-incorrectly-when-file-references-used-in-dependencies/1412

For now, the only workaround is to fully install node_modules.

@rarkins rarkins added ready priority-2-high Bugs impacting wide number of users or very important features manager:npm package.json files (npm/yarn/pnpm) labels Aug 15, 2018
@rarkins
Copy link
Collaborator Author

rarkins commented Aug 15, 2018

@martijnwalraven I have added an option to perform a full npm install on the bot every time in #2390. I tested using this option on a fork of apollographql/apollo-server and the Pin Dependencies PR (correctly) kept the package-lock.json unchanged. I will need to explicitly/manually enable this setting for apollographql/apollo-server in the app, because I have made this an admin-only option so that only the bot admin can enable it and not any repository user.

@rarkins rarkins added priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others and removed priority-2-high Bugs impacting wide number of users or very important features labels Aug 16, 2018
@abernix
Copy link
Contributor

abernix commented Aug 16, 2018

Thanks for looking at this, and for building in the work-around, @rarkins.

Can we go ahead and enable skipInstalls on apollographql/apollo-server (I suppose you can verify that I'm authorized based on the access I've demonstrated in this PR, but I'm happy to verify in some other way), and I'll follow along with the bug report you opened on npm.community so we remember to turn it off.

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 16, 2018

I’ve enabled it already for your repo so no need for extra config on the repo. Any PR that’s created or rebased from now on should have a correct lockfile attached.

@hwillson
Copy link

@rarkins We're about to merge similar file reference changes into Apollo Client (see apollographql/apollo-client#3817). Any chance we could also have skipInstalls enabled on that repo? Thanks!

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 16, 2018

Yes, I can do that. I’m thinking of making it automatic for any repo that has file: dependencies too

@hwillson
Copy link

That would be awesome! We're switching to using file references in a few other repos shortly, so that would really help. Thanks!

@rarkins
Copy link
Collaborator Author

rarkins commented Aug 17, 2018

I’ve now switched on full installs any time a “file:” dependency is included with npm directly or via Lerna. Hopefully npm can fix this soon though as it adds to the bot’s workload significantly!

@hwillson
Copy link

Ouch, I bet the workload just shot up 🙁. Thanks for jumping on this so quickly @rarkins!

@rarkins rarkins added blocked and removed ready labels Aug 26, 2018
@rarkins rarkins removed the blocked label Jun 18, 2020
@rarkins rarkins added status:blocked Issue is blocked by another issue or external requirement status:in-progress Someone is working on implementation and removed status:in-progress Someone is working on implementation labels Jan 12, 2021
@rarkins rarkins closed this as completed Aug 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
manager:npm package.json files (npm/yarn/pnpm) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:blocked Issue is blocked by another issue or external requirement
Projects
None yet
Development

No branches or pull requests

3 participants