sindresorhus / open

Open stuff like URLs, files, executables. Cross-platform.
MIT License
3.14k stars 213 forks source link

Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:412:11) at Object.spawn (node:child_process:698:9) at module.exports (C:\Users\{username}\Downloads\{react-project-name}\node_modules\better-opn\node_modules\open\index.js:175:34) { errno: -4094, code: 'UNKNOWN', syscall: 'spawn' } #300

Open PuneetAsnani12 opened 1 year ago

PuneetAsnani12 commented 1 year ago

When trying to start storybook, I'm getting this error:

Error: spawn UNKNOWN at ChildProcess.spawn (node:internal/child_process:412:11) at Object.spawn (node:child_process:698:9) at module.exports (C:\Users\{User}\Downloads\{react-project-name}\node_modules\better-opn\node_modules\open\index.js:175:34) { errno: -4094, code: 'UNKNOWN', syscall: 'spawn' }

After a bit of debugging, I came to know that System32/WindowsPowerShell/v1.0/powershell.exe is blocked by my organization, which this library is clearly trying to access:

image

FYI: system does allow Powershell (x86) to open through SysWOW64\WindowsPowerShell\v1.0

Can we add some conditions in command variable to check whether the system is x64-based or not ?