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

npx create-react-app my-app commits .yarn directory with all the dependecines to git #11010

Open
jsyrjala opened this issue May 25, 2021 · 1 comment

Comments

@jsyrjala
Copy link

jsyrjala commented May 25, 2021

Describe the bug

Running npx create-react-app my-app creates a .yarn directory with about 80 megabytes of dependencies and commits it to git.

Did you try recovering your dependencies?

Not related to issue

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

Environment Info:

  current version of create-react-app: 4.0.3
  running from /Users/xxx/node_modules/create-react-app

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  Binaries:
    Node: 16.2.0 - /usr/local/bin/node
    Yarn: 2.4.1 - /usr/local/bin/yarn
    npm: 7.14.0 - /usr/local/bin/npm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Firefox: Not Found
    Safari: 14.1
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

  1. npx create-react-app my-app
du -h .yarn
...
4.0K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es/weak-set
116K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es/string/virtual
256K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es/string
4.0K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es/set
 16K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es/array-buffer
1.3M	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/es
1.4M	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/modules
136K	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure/proposals
7.0M	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules/core-js-pure
7.0M	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8/node_modules
7.0M	.yarn/unplugged/core-js-pure-npm-3.9.0-fed8ed49b8
 30M	.yarn/unplugged
 76M	.yarn
du -h .git
...
 60K	.git/hooks
4.0K	.git/refs/heads
  0B	.git/refs/tags
4.0K	.git/refs
 55M	.git

.gitignore should probably contain /.yarn, but it doesn't.

cat .gitignore 
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
git log .yarn/install-state.gz | cat
commit 2b67c7c8cc70c565ec4082840ae64a2115adb873
Author: xxx
Date:   Tue May 25 11:25:51 2021 +0300

    Initialize project using Create React App

Expected behavior

I expect that packages/dependencies are not committed to git.
Either .yarn directory should be added to .gitignore or npx should use npm to install packages.

Actual behavior

After running npx create-react-app my-app there bunch of packages committed to git.

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@gausie
Copy link

gausie commented May 31, 2021

Most of the .yarn folder is meant to be commited with yarn 2. See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

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

No branches or pull requests

2 participants