Skip to content

I can't install react with npx create-react app #12650

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

Open
Korintios opened this issue Aug 10, 2022 · 4 comments
Open

I can't install react with npx create-react app #12650

Korintios opened this issue Aug 10, 2022 · 4 comments

Comments

@Korintios
Copy link

I can install react but for a weird reason this bug appear :(

npx create-react-app inicio
npm WARN config global --global, --local are deprecated. Use --location=global instead.

Creating a new React app in C:\Users\USUARIO\Desktop\REACT\inicio.

npm WARN config global --global, --local are deprecated. Use --location=global instead.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:700:9)
at spawn (C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:383:19
at new Promise ()
at install (C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:461:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}

Deleting generated file... package.json
Deleting inicio/ from C:\Users\USUARIO\Desktop\REACT
Done.

@suyashjoshi404
Copy link

suyashjoshi404 commented Aug 10, 2022

I would recommend going to your nodejs directory in program files and changing the following files: npm, npm.cmd, npx, npx.cmd. Over there, change and place prefix -g with prefix --location=global in the files.

@Korintios
Copy link
Author

Korintios commented Aug 10, 2022

I would recommend going to your nodejs directory in program files and changing the following files: npm, npm.cmd, npx, npx.cmd. Over there, change and place prefix -g with prefix --location=global in the files.

I continue the steps in your answers but the app of react don't create :(

C:\Users\USUARIO\Desktop\REACT>npx create-react-app inicio

Creating a new React app in C:\Users\USUARIO\Desktop\REACT\inicio.

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

Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:700:9)
at spawn (C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:383:19
at new Promise ()
at install (C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\USUARIO\AppData\Local\npm-cache_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:461:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}

Deleting generated file... package.json
Deleting inicio/ from C:\Users\USUARIO\Desktop\REACT
Done.

@suyashjoshi404
Copy link

suyashjoshi404 commented Aug 10, 2022

Try referring to Issue #12185.

@chammi-hansana
Copy link

Use a different network:Different Wi-Fi network or using a mobile hotspot.Then try again to create the react app, npx create-react-app <project_name>

Hope this should help you.This Works For me.

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

4 participants
@chammi-hansana @Korintios @suyashjoshi404 and others