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

windows 11 unknown spawn error error code -4094 #3819

Open
justincando opened this issue Apr 7, 2022 · 12 comments
Open

windows 11 unknown spawn error error code -4094 #3819

justincando opened this issue Apr 7, 2022 · 12 comments
Labels

Comments

@justincando
Copy link

Details

when running npx create-react-app my-app I get this error and it tells me to report this as a bug.

Node.js version

v16.14.2

Example code

npx create-react-app my-app

Operating system

windows 11

Scope

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\steel\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24)
at C:\Users\steel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:390:19
at new Promise ()
at install (C:\Users\steel\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:341:10)
at C:\Users\steel\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 my-app/ from D:\testreact
Done.

Module and version

Not applicable.

@rilysh
Copy link

rilysh commented Apr 14, 2022

It looks like the child process failed to spawn an application. Can you provide some more context, that gives some more information?

@stefanO2602
Copy link

stefanO2602 commented Jul 11, 2022

I have a similar problem when running unit tests with jest and the mongodb-memory-server package (https://github.com/nodkz/mongodb-memory-server).

When running a sample script starting the server (binaries fully downloaded, no local mongod instance running locally), I get a similar error like in the issue desription.

Node.js version
v16.15.1

package.json
{ "devDependencies": { "nodemon": "^2.0.18", "ts-node": "^10.8.2", "typescript": "^4.7.4" }, "dependencies": { "mongodb-memory-server": "^8.7.2" }, "config": { "mongodbMemoryServer": { "debug": "1" } } }

Example code

import { MongoMemoryServer } from 'mongodb-memory-server';

(async () => {
    const mongod = await MongoMemoryServer.create();
    const uri = mongod.getUri();
    console.log('uri: ', uri);
    await mongod.stop();
})();

Log output

MongoMS:MongoMemoryServer Mongo[unknown]: _startUpInstance threw a Error: Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:413:11)
at spawn (node:child_process:700:9)
at MongoInstance._launchMongod (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\mongodb-memory-server-core\src\util\MongoInstance.ts:443:31)
at MongoInstance. (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\mongodb-memory-server-core\src\util\MongoInstance.ts:345:31)
at Generator.next ()
at fulfilled (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\tslib\tslib.js:115:62) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
} +603ms
MongoMS:MongoMemoryServer Mongo[unknown]: stop: Called .stop() method +10ms
MongoMS:MongoMemoryServer Mongo[unknown]: stop: "instanceInfo" is not defined (never ran?) +0ms
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:413:11)
at spawn (node:child_process:700:9)
at MongoInstance._launchMongod (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\mongodb-memory-server-core\src\util\MongoInstance.ts:443:31)
at MongoInstance. (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\mongodb-memory-server-core\src\util\MongoInstance.ts:345:31)
at Generator.next ()
at fulfilled (C:\Users\user-name\Projects\testing\mongodb-memory-server\node_modules\tslib\tslib.js:115:62) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}

@MoLow MoLow added the Windows label Jul 17, 2022
@o0101
Copy link

o0101 commented Feb 7, 2023

Also seeing this on Parallels Windows 11

@idodidodi
Copy link

I have the same issue, one time when I tried to build an Electron app with --watch, and at the same time, when running a subprocess while building a Python app, it seemed like a local issue, maybe related to 'win error' 225

@juleskreutzer
Copy link

Has anyone been able to resolve their issue? We're running into a simular issue when running unit tests in our pipelines...

@idodidodi
Copy link

idodidodi commented May 3, 2023 via email

@juleskreutzer
Copy link

juleskreutzer commented May 3, 2023 via email

@pogiaron
Copy link

pogiaron commented Feb 4, 2024

I think a wrapper batch script may be missing. And the script tries to run a js file with execFileSync.

Let's consider these scripts:

log.js

#!/usr/bin/env node
console.log("log.js");

test.js

const { execFileSync  } = require('child_process');
const cmd = 'C:\\pathto\\log.js';  //on ubuntu '/pathto/log.js'
execFileSync(cmd, {stdio: 'inherit'});

if you run the test.js in Windows you will get this error:
Error: spawnSync C:\pathto\log.js UNKNOWN

if you run the test.js on Unix-like platforms it will run

https://stackoverflow.com/a/33510581
https://stackoverflow.com/questions/37585966/node-modules-bin-package-cmd-file-in-node-js/44468968#44468968

@RedYetiDev
Copy link
Member

Is this issue still occuring? If not, feel free to self-close.

@JuniperBarry2rr
Copy link

I never found a fix I just got a new computer

@Beboz1
Copy link

Beboz1 commented Aug 15, 2024

I have the same problem even if I try npx electron . And npx nw . I need help help me

@JuniperBarry2rr
Copy link

I have the same problem even if I try npx electron . And npx nw . I need help help me

Kind of the fix for me was learning it was a bad install what I did was fully uninstall it then reinstalled it.
That did not work so I factory restored my computer due to other issue that worked for me.

Just something corrupts for some reason...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests