-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Remove one of package-lock.json and yarn.lock on gatsby new #13210
Comments
@JacobBlomgren Want to take a stab at this? |
Just remembered that we added @renovate[bot] and it'll handle updates to both So all we really need to do is, during
The remove operations should not fail if the file doesn't exist (since starters from the community could contain one or two or none) We could also prompt, but since we internally use yarn currently if it is available (https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-cli/src/init-starter.js#L16-L28), we should just consistently do that for now |
Just to clarify: the check should be "if should use yarn" ( |
The real long-term solution here is to ask people which client they use on their first |
Regarding of your discussion I made a first implementation that seems to solve this issue. I used prompts to ask user which package manager he wants to use then remove the unwanted lock file. |
…tsby new (#13225) ## Description I made a first implementation that asks user with [prompts](https://github.com/terkelg/prompts) which package manager he wants to use. ## Related Issues Related to issue #13210
Should I close this ? |
Yeah this has been resolved so I'll close it. |
'npm install' creates package-lock.json and 'yarn install' generates yarn.lock . Normally you stick to either one of the package managers in your project instead of having both.. |
Our starters currently include both
package-lock.json
andyarn.lock
This typically leads to some confusion due to yarn's warning (#4514 (comment))
And in worst case, inconsistencies between the two, leading to issues like #13194
Potential solution
It'd be nice to remove both lock files altogether but we can't because of #10607 (comment)
We could remove
yarn.lock
from the starter repositories and runyarn import
ifyarn
is detected (this solves inconsistencies in the starter itself as well as inconsistencies after the project is created if both files are still present like in #13194)What do you think @DSchau @KyleAMathews?
The text was updated successfully, but these errors were encountered: