-
Notifications
You must be signed in to change notification settings - Fork 612
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
fix: prevent yarn usage #2858
fix: prevent yarn usage #2858
Conversation
Gumichocopengin8
commented
Oct 1, 2020
- prevent to use yarn instead of npm
- these days, many people use yarn, so it can be possible to make a mistake to use yarn instead of npm
- in order to avoid the annoying mistake, I created this PR.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sgrif (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -115,6 +115,7 @@ | |||
}, | |||
"engines": { | |||
"node": "^12.9.1", | |||
"npm": "^6.10.2" | |||
"npm": "^6.10.2", | |||
"yarn": "please_use_npm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the effect of this?
technically using yarn should be fine. the only downside would be that the lockfile is not taken into account when installing through yarn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this helps you - https://stackoverflow.com/questions/57328593/prevent-yarn-install-from-running-in-project-i-e-force-npm-install
In my opinion , we should stick to yarn or npm, not both because of lock file. So far, this repo is using npm, so I just added a restriction that prevents using yarn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of this PR, but the implementation seems to add even more confusing error message. Currently, if you run yarn you get a warning at the top about the presence of an npm lockfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@locks
I don't think it is confusing. yarnpkg/yarn#4895 (comment) suggests this too.
I think a warning is not sufficient to prevent yarn because some ppl don't pay attention to warnings.
What do you think, @Turbo87?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even though I'm using npm
to install the dependencies I usually still use things like yarn test
and yarn start:live
because I'm used to using yarn from other projects and have several shell aliases set up for things like this.
while I appreciate the idea and effort, I think I would prefer to not merge this 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Turbo87
I see. That makes sense. Thank you for reviewing it anyways!
I'll close this PR.