Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\Vishnu\react> npx create-react-app vikas
Creating a new React app in C:\Users\Vishnu\react\vikas.
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:412:11)
at Object.spawn (node:child_process:698:9)
at spawn (C:\Users\Vishnu\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Vishnu\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:407:19
at new Promise (<anonymous>)
at install (C:\Users\Vishnu\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:359:10)
at C:\Users\Vishnu\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:485:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
Deleting generated file... package.json
Deleting vikas/ from C:\Users\Vishnu\react
Done.
PS C:\Users\Vishnu\react> npx create-react-app vikas
Follow the Following Steps.
open powershell/cmd and run.
npm cache clean --force
Run
npm cache verify
Run
npm install create-react-app vikas
Run
npx create-react-app vikas
Related
i install node.js then trying to create first react app by using npx create-react-app my-app in power shell and it cames following error.
PS C:\Users\Owner> npx create-react-app my-app
Creating a new React app in C:\Users\Owner\my-app.
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:420:11)
at Object.spawn (node:child_process:733:9)
at spawn (C:\Users\Owner\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Owner\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:383:19
at new Promise (<anonymous>)
at install (C:\Users\Owner\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\Owner\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 my-app/ from C:\Users\Owner
Done.
PS C:\Users\Owner>
I have been searching for solutions for hours and tried different methods but still didn't work. Can anyone please help?
node --version
v16.18.0
npm --version
8.19.2
Thanks in advance
Whenever I try to run
npx create-react-app my-app
it gives me error.
I got stuck here can anyone help?
PS E:\ALI\Eziline work\React work> npx create-react-app my-app
Creating a new React app in E:\ALI\Eziline work\React work\my-app.
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:713:9)
at spawn (C:\Users\Syed Taha Ali\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Syed Taha Ali\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:383:19
at new Promise (<anonymous>)
at install (C:\Users\Syed Taha Ali\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\Syed Taha Ali\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 my-app/ from E:\ALI\Eziline work\React work
Done.
This is the error I always face.
install node.js
if you already installed that clear your cache using
npm cache clean --force and try again
Your environment has been set up for using Node.js 18.2.0 (x64) and npm.
C:\Users\aanan>npx create-react-app my-app
Creating a new React app in C:\Users\aanan\my-app.
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:689:9)
at spawn (C:\Users\aanan\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\aanan\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:383:19
at new Promise (<anonymous>)
at install (C:\Users\aanan\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:334:10)
at C:\Users\aanan\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:461:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
Deleting generated file... package.json
Deleting my-app/ from C:\Users\aanan
Done.
C:\Users\aanan>
D:\IT\Practic work\React> create-react-app test
Creating a new React app in D:\IT\Practic work\React\test.
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\Roman Borodai\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Roman Borodai\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:390:19
at new Promise (<anonymous>)
at install (C:\Users\Roman Borodai\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:341:10)
at C:\Users\Roman Borodai\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:468:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
Deleting generated file... package.json
Deleting test/ from D:\IT\Practic work\React
Done.
I faced the same issue and resolved it this way. Steps in sequence:
npm uninstall -g create-react-app
yarn global remove create-react-app (If yarn used)
npm update npx
npm audit fix --force
npx create-react-app your-app-name
I referred this post: https://betterprogramming.pub/what-to-do-if-create-react-app-doesnt-work-ad601b4c238
I am trying to create a react application, but it gives the following errors:
Creating a new React app in C:\Users\Admin\Desktop\study\portfoliosite\mysite\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-typescript...
Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:412:11)
at Object.spawn (node:child_process:698:9)
at spawn (C:\Users\Admin\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\cross-spawn\index.js:12:24)
at C:\Users\Admin\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:390:19
at new Promise (<anonymous>)
at install (C:\Users\Admin\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:341:10)
at C:\Users\Admin\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:468:16
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
Deleting generated file... package.json
Deleting my-app/ from C:\Users\Admin\Desktop\study\portfoliosite\mysite
Done.
I had the same exact error. It was because my anti-virus software viewed the react installation as malware.
Try to clean the cache npm cache clean --force than npx clear-npx-cache and run again npx create-react-app my-app or npx create-react-app#latest my-app --use-npm.
If You still have this problem run Try to run cmd as administrator.
If You installed create-react-app globaly than run npm uninstall -g create-react-app.
Also notice that create-react-app required Node >= 14.0.0 and npm >= 5.6 on your machine
For me It's a antivirus issue, update your antivirus and try. I have faced this issue in windows 11.
Scan your pc/laptop with updated antivirus