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 is not working? why? #13704

Open
backup-bs-1221 opened this issue Nov 7, 2024 · 2 comments
Open

npx create-react-app is not working? why? #13704

backup-bs-1221 opened this issue Nov 7, 2024 · 2 comments

Comments

@backup-bs-1221
Copy link

For some reason when I tried to start a new project and run the npx command, i had met this issue. I tried to google this reason but no avail. It says issues with git so I tried to log in on terminal but it is still giving me the same error. Any idea why this would happen? Thanks.

======================================================================
root@tabulaRasa:/mnt/c/Users/tabul/OneDrive/Desktop/DTC web/temp# npx create-react-app your-project

Creating a new React app in C:\Users\tabul\OneDrive\Desktop\DTC web\temp\your-project.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

added 1312 packages in 13s

259 packages are looking for funding
run npm fund for details
Git repo not initialized Error: Command failed: git --version
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at tryGitInit (C:\Users\tabul\OneDrive\Desktop\DTC web\temp\your-project\node_modules\react-scripts\scripts\init.js:46:5)
at module.exports (C:\Users\tabul\OneDrive\Desktop\DTC web\temp\your-project\node_modules\react-scripts\scripts\init.js:276:7)
at [eval]:3:14
at runScriptInThisContext (node:internal/vm:209:10)
at node:internal/process/execution:118:14
at [eval]-wrapper:6:24 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 9820,
stdout: null,
stderr: null
}

Installing template dependencies using npm...
Unknown command: "install$1$1"

Did you mean this?
npm install # Install a package
To see a list of supported npm commands, run:
npm help
npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^13.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0 failed

@Gokul-sundar-softwaredev

I too face this issue when i try to install react
I do this it worked for me
1.Install bun using npm
npm install -g bun
2. check you installed bun or not
bun --version
3. create react-app using bun
bun create react-app your-project

@AmnaMansha
Copy link

Sometimes this type of error is due to the cache try to clean the cache then try again :
1-npm uninstall -g create-react-app
2-npm cache clean --force
3-npx create-react-app project_name --template all

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

3 participants