cli: Could not create an empty Git repository, see debug logs with --verbose

Environment

  • react-native@0.73.4
  • Darwin macbook-air 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:34 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8103 arm64

Description

Trying to init a new react native project.

Upon running npx react-native@latest init myapp It throws the following error. Also the create folder is empty.

Downloading template error
✖ Downloading template
✖ Could not create an empty Git repository, see debug logs with --verbose

I have attached a screenshot of the error below.

image

Similar issue #2212 | Proposed/Merged fix: #2215 But it’s still occuring.

Reproducible Demo

Create a new React Native project with the command npx react-native@latest init myapp


Also, when you run npx react-native info it says unknown command.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17

Most upvoted comments

this also happend on windows 11 image

I have solved this problems by deleting yarn.lock, package.json, package-lock.json in C:\Users\ACER image

Alright, so let’s keep the latest version of Yarn, as it’s faster and more secure. Thanks for digging into this issue! 🙏

Can you try with --npm?