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

add yarn.lock to .gitignore #2014

Closed
wants to merge 2 commits into from

Conversation

viankakrisna
Copy link
Contributor

I'm often cleaning my node_modules and reinstall it with yarn, and i notice that it always creates a new yarn.lock file. I think we should decide wether we want yarn.lock on the root of this project or not.

If we want to add it it, i'll close this and do #2012 instead.

@yordis
Copy link

yordis commented Apr 23, 2017

IMO, the actual fix is adding the yarn.lock to the project.

@straku
Copy link

straku commented May 11, 2017

Yes, @yordis is right. Check out corresponding section in yarn documentation. https://yarnpkg.com/en/docs/yarn-lock#toc-check-into-source-control

@gaearon gaearon closed this May 11, 2017
@gaearon
Copy link
Contributor

gaearon commented May 11, 2017

IMO, the actual fix is adding the yarn.lock to the project.

It is the right thing to do for apps but not for us (tools) because we want any problems with downstream deps to be caught by our CI.

I'm often cleaning my node_modules and reinstall it with yarn, and i notice that it always creates a new yarn.lock file

I was about to merge it, but then realized in this case yarn.lock would stay on your computer forever, and then CRA developers would potentially get locked on different tool versions. This will make it harder to diagnose problems in development. So I'd rather leave with it untracked.

There's likely some way to run yarn without creating a lockfile. That's what you should do when working on CRA.

@jdickey
Copy link

jdickey commented May 11, 2017

@gaearon To install without generating a yarn.lock, run yarn install --no-lockfile.

I'd also argue that we should consider adding --prefer-offline to pull packages from cache instead of downloading on each install. Thoughts?

@gaearon
Copy link
Contributor

gaearon commented May 11, 2017

For CRA development, I want the latest versions so when deps introduce bugs, we can quickly see and fix them.

@viankakrisna
Copy link
Contributor Author

viankakrisna commented May 12, 2017

@gaearon nice catch! maybe we should add in CONTRIBUTING.md for yarn users that they should do yarn install --no-lockfile

@jdickey thanks for the tip!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants