pkg
pkg copied to clipboard
Error: spawn UNKNOWN
What version of pkg are you using?
5.7.0
What version of Node.js are you using?
16.14.2
What operating system are you using?
Windows
What CPU architecture are you using?
arm64
What Node versions, OSs and CPU architectures are you building for?
node16-win-arm64 and node14-win-arm64
Describe the Bug
All attempts to use pkg to package any js file lead to this single error, I have also created a simple hello world file to turn into an exe as a test with same results as my projects. A exe file is generated but completely unusable state.
I don't know if I'm just stupid and missed something or if pkg is just completely broken.
Expected Behavior
A exe should generate that logs hello world.
To Reproduce
Steps taken: create single file with console.log("hello world");
run command pkg -t node16-win-arm64 index.js
(error occurs in both Git Bash and CMD and with both node14 and node16 have not tested others)
still get error
node:internal/child_process:413
throw errnoException(err, 'spawn');
^
Error: spawn UNKNOWN
at ChildProcess.spawn (node:internal/child_process:413:11)
at spawn (node:child_process:700:9)
at fabricate (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\fabricator.js:55:51)
at fabricateTwice (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\fabricator.js:120:5)
at MultiStream._queue (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\producer.js:266:68)
at MultiStream._next (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\node_modules\multistream\index.js:86:12)
at Meter.onEnd (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\node_modules\multistream\index.js:129:12)
at Object.onceWrapper (node:events:645:28)
at Meter.emit (node:events:526:28)
at endReadableNT (node:internal/streams/readable:1345:12) {
errno: -4094,
code: 'UNKNOWN',
syscall: 'spawn'
}
I'm having this exactly issue when trying to target arm64 on a Windows machine
same problem here, does anyone know how to solve it?
@Atlas16A try using pkg -t node16.16.0-win-x64 index.js
, worked for me.
same problem here, does anyone know how to solve it?
My problem was I was attempting to compile a native linux ARM executable on x86-64 architecture. Vercel documentation clearly states this is not possible. My workaround was to compile a linux x86-64 executable, then use qemu-user to run this under emulation in linux. Hope this helps.
Same problem My system is win-x86 When use pkg,will fetch linux-arm64 and win-arm64,but my system is x86,is the question? English is not good~~~
What version of pkg are you using?
5.7.0
What version of Node.js are you using?
16.14.2
What operating system are you using?
Windows
What CPU architecture are you using?
arm64
What Node versions, OSs and CPU architectures are you building for?
node16-win-arm64 and node14-win-arm64
Describe the Bug
All attempts to use pkg to package any js file lead to this single error, I have also created a simple hello world file to turn into an exe as a test with same results as my projects. A exe file is generated but completely unusable state.
I don't know if I'm just stupid and missed something or if pkg is just completely broken.
Expected Behavior
A exe should generate that logs hello world.
To Reproduce
Steps taken: create single file with console.log("hello world");
run command
pkg -t node16-win-arm64 index.js
(error occurs in both Git Bash and CMD and with both node14 and node16 have not tested others)still get error
node:internal/child_process:413 throw errnoException(err, 'spawn'); ^ Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:413:11) at spawn (node:child_process:700:9) at fabricate (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\fabricator.js:55:51) at fabricateTwice (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\fabricator.js:120:5) at MultiStream._queue (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\lib-es5\producer.js:266:68) at MultiStream._next (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\node_modules\multistream\index.js:86:12) at Meter.onEnd (C:\Users\tomsh\AppData\Roaming\nvm\v16.14.2\node_modules\pkg\node_modules\multistream\index.js:129:12) at Object.onceWrapper (node:events:645:28) at Meter.emit (node:events:526:28) at endReadableNT (node:internal/streams/readable:1345:12) { errno: -4094, code: 'UNKNOWN', syscall: 'spawn' }
The source code needs to be copied and packaged on a computer with arm architecture
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
Same.
Seeing this on 5.8 on Parallels but unknown if it's a pkg issue
https://github.com/vercel/pkg#targets
try add options
--no-bytecode --public-packages "*" --public
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.