facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.69k stars 26.84k forks source link

Error: spawn UNKNOWN #10670

Open gilang-novrizal opened 3 years ago

gilang-novrizal commented 3 years ago

When I try to run a basics npx create-react-app i received this error

D:\>npx create-react-app abc
npx: installed 67 in 4.255s

Creating a new React app in D:\abc.

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 (internal/child_process.js:403:11)
    at Object.spawn (child_process.js:553:9)
    at spawn (C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24)
    at C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:407:19
    at new Promise (<anonymous>)
    at install (C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:359:10)
    at C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:485:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  errno: -4094,
  code: 'UNKNOWN',
  syscall: 'spawn'
}

Deleting generated file... package.json
Deleting abc/ from D:\
Done.

I'm using windows 10 version 20H2 and node v14.15.4.

Shivamkosta commented 3 years ago

When I try to run a basics npx create-react-app i received this error

itshubham2710 commented 3 years ago

When I try to run a basics npx create-react-app I received this error. I don't know how to solve it?

Arashcarryme commented 2 years ago

That happens when I try to make a React Project by: "npx create-react-app" command!

ColdJadedEyes08 commented 2 years ago

When I try to run a basics npx create-react-app i received this error


D:\>npx create-react-app abc

npx: installed 67 in 4.255s

Creating a new React app in D:\abc.

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 (internal/child_process.js:403:11)

    at Object.spawn (child_process.js:553:9)

    at spawn (C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24)

    at C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:407:19

    at new Promise (<anonymous>)

    at install (C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:359:10)

    at C:\Users\Gilang\AppData\Roaming\npm-cache\_npx\17768\node_modules\create-react-app\createReactApp.js:485:16

    at processTicksAndRejections (internal/process/task_queues.js:93:5) {

  errno: -4094,

  code: 'UNKNOWN',

  syscall: 'spawn'

}

Deleting generated file... package.json

Deleting abc/ from D:\

Done.

I'm using windows 10 version 20H2 and node v14.15.4.

AhmedYounsi commented 2 years ago

any solution ?

TahirMehmood commented 2 years ago

anyone know solution ? how can i create react app? i am newbie???

preacher07 commented 2 years ago

am also with this same mistake, online for a long time also did not find a way to solve, node reinstallation is useless, hope big guy extend a helping hand

Matherss commented 2 years ago

i have same problem... i tried all answers from stackoverflow ( delete npm, npx cache), reinstall node.js, but i still have that problem

`

PS C:\Users\Admin\Desktop\study\portfoliosite> npx create-react-app my-app Need to install the following packages: create-react-app Ok to proceed? (y) y npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

Creating a new React app in C:\Users\Admin\Desktop\study\portfoliosite\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: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 () 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 Done. PS C:\Users\Admin\Desktop\study\portfoliosite>

`

PS C:\Users\Admin\Desktop\study\portfoliosite> node -v v16.13.1 PS C:\Users\Admin\Desktop\study\portfoliosite> npm -v 8.3.0 PS C:\Users\Admin\Desktop\study\portfoliosite> npx -v 8.3.0

wahyunandanovan commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

Raj-kishore commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

Same here

AasifFiraz commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

I removed the antivirus but still it does not work

wahyunandanovan commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

I removed the antivirus but still it does not work

if there are other antivirus on your computer, try deleting them all.

AasifFiraz commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

I removed the antivirus but still it does not work

if there are other antivirus on your computer, try deleting them all.

No I don't have any other antivirus and also I tried everything. Nothing seems to work. I have been banging my head on this error for more than 2 days.

rizwanullah313 commented 2 years ago

first you need to run this script npm install -g create-react-app

after that run npx create-react-app my-app

moamen2020 commented 2 years ago

I've had this problem, the solution is that I uninstalled the antivirus from my computer

joaovlev commented 2 years ago

I have the same problem when i tried to run create-react-app. I'm still trying to solve it, but i can't find a solution.

AasifFiraz commented 2 years ago

I have the same problem when i tried to run create-react-app. I'm still trying to solve it, but i can't find a solution.

Hi, so I solved it by deleting Node modules from my local disk C and also the user folder. Removed everything related to npm. After that I restarted my computer and installed everything from scratch. Surprisingly it worked for me. Let me know how it goes

joaovlev commented 2 years ago

I have the same problem when i tried to run create-react-app. I'm still trying to solve it, but i can't find a solution.

Hi, so I solved it by deleting Node modules from my local disk C and also the user folder. Removed everything related to npm. After that I restarted my computer and installed everything from scratch. Surprisingly it worked for me. Let me know how it goes

Let me try it. I'm deleting my user folder. I'll back here in some minutes.

AasifFiraz commented 2 years ago

If this still does not work clone a copy of the boilerplate code which is after you use npx create-react-app. Before I solved this I did this and worked for me. I'll send a GitHub boiler plate code Download you can use. Clone it and make sure to run npm install after u get the file on your computer to install all the modules, then run npm start and you will be good to go :)

Amitpandey241 commented 2 years ago

Have a look at this, it worked for me https://stackoverflow.com/a/72879257/15512430

kompargroup commented 2 years ago

try to delete your antivirus

peipakoa commented 2 years ago

I already did everything mentioned above. I only have MS Defender antivirus. Do I have to delete it to?

Amitpandey241 commented 2 years ago

I already did everything mentioned above. I only have MS Defender antivirus. Do I have to delete it to?

No you don't have delete ms defender antivirus you need to disable it

peipakoa commented 2 years ago

just disabled it. I still experience the same error.

Amitpandey241 commented 2 years ago

just disabled it. I still experience the same error.

can we connect?

Amitpandey241 commented 2 years ago

just disabled it. I still experience the same error.

can we connect?

when u disabled it try to run npx create-react-app

peipakoa commented 2 years ago

connect?

still does not work.

just disabled it. I still experience the same error.

can we connect?

when u disabled it try to run npx create-react-app

Amitpandey241 commented 2 years ago

connect?

still does not work.

just disabled it. I still experience the same error.

can we connect?

when u disabled it try to run npx create-react-app

is there an other antivires? can we have a meeting on google meet or something?

peipakoa commented 2 years ago

connect? still does not work.

just disabled it. I still experience the same error.

can we connect?

when u disabled it try to run npx create-react-app

is there an other antivires? can we have a meeting on google meet or something?

real-time protection says i'm using other anitivirus provider but i've already uninstalled all besides ms defender. can you send the code for google meet?

masoudmerzaye2020 commented 2 years ago

I had the same issue, I tried uninstalling and updating node and vscode but it didn't work.

and then I uninstalled the antivirus and restarted my PC, the problem solved

mahsanr44 commented 1 year ago

Solved by uninstalling antivirus and VPN. you should try doing this.

DisaraMethmali commented 9 months ago

:\Users\CE MO01\Downloads\react>npx create-react-app my-app 'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ENOENT npm ERR! syscall spawn C:\Users\CE MO01\Downloads\jdk-20.0.1\bin npm ERR! path C:\Users\CE MO01\Downloads\react npm ERR! errno -4058 npm ERR! enoent spawn C:\Users\CE MO01\Downloads\jdk-20.0.1\bin ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\CE MO01\AppData\Local\npm-cache_logs\2024-01-15T20_21_46_432Z-debug-0.log

please help me for resolved this error