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

Error when space is used in process.execPath - spawn ENOENT at erronoException (child_process.js:980:11) on win2k8server with node v0.10.15 #38

Closed
jfrux opened this issue Jul 30, 2013 · 4 comments

Comments

@jfrux
Copy link

jfrux commented Jul 30, 2013

When running this way I get the error.

worker = new forever.Monitor("worker.js", {
    silent: false,
    fork: true,
    max: 1,
    sourceDir: process.cwd(),
    options: args
});

It works when using:

worker = cp.fork("worker.js");
worker.send(monitorConfig);
@jfrux
Copy link
Author

jfrux commented Jul 31, 2013

Okay...
Discovered that on this particular windows machine node.js installs to default directory of "C:\Program Files\nodejs"

process.execPath returns C:\Program Files\nodejs\node.exe

On line 226 of file monitor.js it has cmdarr = this.command.trim().split(/\s+/); which is obviously making the command C:\Program and the "script" to run is Files\node.exe or whatever.

Any tips for handling this?

@jfrux
Copy link
Author

jfrux commented Jul 31, 2013

So I've come to the conclusion that the only real way to do this would be to pass the { command: 'node.exe' } instead of letting forever-monitor determine the pathExec?

@jfrux
Copy link
Author

jfrux commented Jul 31, 2013

Okay, ended up fixing this with:

worker = new (forever.Monitor)("worker.js",
    silent:false
    fork:true
    command:process.execPath.replace('Program Files','Progra~1')
    max:1
    sourceDir: process.cwd()
    options:args
  )

@jfrux jfrux closed this as completed Jul 31, 2013
@FredrikNoren
Copy link

+1 on this issue (should this really be closed if the original problem wasn't solved?)

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

No branches or pull requests

2 participants