node.js child_process.spawn ENOENT error - only under supervisord - node.js

I'm running a command with Node.js using child_process.spawn:
#!/usr/bin/js
var spawn = require("child_process").spawn;
var stockfish = spawn("stockfish");
This works fine using $js spawntest.js from the command line; it just hangs like you would expect because the subcommand is waiting for input.
When I set this script up as a supervisord program, however, it fails:
$ sudo supervisorctl start spawntest
spawntest: ERROR (abnormal termination)
Here is the contents of the stderror output log that supervisor keeps in /var/log/supervisor/spawntest-stderr---supervisor-RyULL0.log:
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
The supervisorctl program is configured like this:
[program:spawntest]
command=/home/gus/dev/spawntest.js
autostart=false
autorestart=false
user=gus
Why is this failing only under Supervisor? Are there any Node.js modules/global variables etc I can use to see what the differences are between invoking a script directly and through Supervisor?

Related

While running command nerdctl run after building an image getting error : Starting the development server... node:

I tried to add system variable path for powershell but it is same as it is. I think its error related to powershell but not sure about
Starting the development server... node:
this.events:491
throw er; // Unhandled 'error' event ^ Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe ENOENT at ChildProcess._handle.onexit (n
Starting the development server...
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Error: spawn ngr ENOENT

I am totally unaware of this kind of error,
whats the causing this error how can I solve it?
cross-env NODE_ENV=development ngr build dev
Console Error.
events.js:165
throw er; // Unhandled 'error' event
^
Error: spawn ngr ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:379:16)
at process._tickCallback (internal/process/next_tick.js:114:19)
at Function.Module.runMain (module.js:692:11)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:666:3
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)
at onErrorNT (internal/child_process.js:379:16)
[... lines matching original stack trace ...]
at bootstrap_node.js:666:3

react-native init error with nodejs

I got this error when I use command react-native init hello in nodejs
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at exports._errnoException (util.js:855:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:455:9)
at process._tickCallback (node.js:369:17)

Yeoman - Gulp spawn cmd enoent

With the help gulp yeoman-webapp 'im wolf. But it also serves on the command line, I get the following error gulp. Can you help me? Thank you in advance.
I work in Windows 10 and 64 bit computing.
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
Try to put in your system variables in the PATH :
C:\Windows\System32;

Node.js SpookyJS: error executing hello.js

I have installed SpookyJS to execute CasperJs commands in Node.js. I Installed it with this command: npm install spooky, I´m using a Centos machine.
the error:
$ node node_modules/spooky/examples/hello.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
Thanks in advance

Resources