Create-react-app: Create React App doesn't create git repository with my template after recent update

Created on 16 Feb 2020  Â·  4Comments  Â·  Source: facebook/create-react-app

Describe the bug

I have made custom template. After recent update ("react-scripts": "3.4.0"), when I run comand npx create-react-app test-template --template quickstart-redux, I'm getting following error:

success Uninstalled packages.
✨  Done in 12.73s.
Git commit not created Error: Command failed: git commit -m "Initialize project using Create React App"
    at checkExecSyncError (child_process.js:610:11)
    at execSync (child_process.js:646:15)
    at tryGitCommit (/Users/dima/Dev/test-husky/node_modules/react-scripts/scripts/init.js:62:5)
    at module.exports (/Users/dima/Dev/test-husky/node_modules/react-scripts/scripts/init.js:335:25)
    at [eval]:3:14
    at Script.runInThisContext (vm.js:120:20)
    at Object.runInThisContext (vm.js:310:38)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at evalScript (internal/process/execution.js:94:25) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 45374,
  stdout: null,
  stderr: null
}
Removing .git directory...

Did you try recovering your dependencies?

Not relevant

Which terms did you search for in User Guide?

cra-template, git, bugs

Environment

Dimas-MacBook-Pro:Dev dima$ npx create-react-app --info
npx: installed 99 in 5.543s

Environment Info:

  current version of create-react-app: 3.4.0
  running from /Users/dima/.npm/_npx/45508/lib/node_modules/create-react-app

  System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 13.5.0 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 79.0.3945.130
    Firefox: 73.0
    Safari: 13.0.5
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

Run npx create-react-app test-template --template quickstart-redux

Expected behavior

Should install CRA with custom template and git repo initialized.

Actual behavior

Installs CRA with custom template, but fails to initialize git.

Reproducible demo

Run npx create-react-app test-template --template quickstart-redux

bug report needs triage stale

Most helpful comment

me too!

All 4 comments

me too!

Found a reason of bug. Repository creation fails, if there are git hooks attached to it. Workaround: disable initial husky configuration.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JimmyLv picture JimmyLv  Â·  3Comments

alleroux picture alleroux  Â·  3Comments

rdamian3 picture rdamian3  Â·  3Comments

DaveLindberg picture DaveLindberg  Â·  3Comments

stopachka picture stopachka  Â·  3Comments