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

I copied and pasted the example code from readme and it gives me an error when I run the .js file #1

Open
jdheeter opened this issue Jun 16, 2016 · 2 comments

Comments

@jdheeter
Copy link

jdheeter commented Jun 16, 2016

C:\Users\BOINC\Desktop\revivetest>node revive.js
{ pid: undefined,
  name: 'test',
  status: 'started',
  exits: 0,
  stops: 0,
  starts: 1,
  errors: 0,
  sleeps: 0,
  crashes: 0,
  restarts: 0,
  exited: null,
  created: 1466055278899,
  stopped: null,
  started: 1466055278930,
  errored: null,
  sleeped: null,
  crashed: null,
  restarted: null,
  sleepTime: 1000,
  paddingTime: 5000,
  maxSleepCount: 1000,
  cwd: '/home/user/code/node/app/.',
  arg: [ 'app.js' ],
  stdout: '/logs/stdout.log',
  stderr: '/logs/stderr.log',
  env: { PORT: 4444 },
  data: {} }
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:139:18)
    at node.js:968:3
@xeaone
Copy link
Owner

xeaone commented Jun 16, 2016

Hey @jdheeter thanks, great to see your trying out the project.

I will take a look as soon as I can but at first glance it looks like it might be because your are using windows system. I have only tested it on Linux and Mac. But I will see what I can do to debug and fix it.

@xeaone
Copy link
Owner

xeaone commented Aug 4, 2016

@jdheeter

I believe the issue is because you did not create the following items. These have to be real paths.

cwd: '/home/user/code/node/app/.',
arg: [ 'app.js' ],
stdout: '/logs/stdout.log',
stderr: '/logs/stderr.log'

arg: Is the file that you want to keep alive or revive. It could have anything in it though.

stdout/stderr: Needs to be a real path that is already created. The file itself does not need to exists but the path does.

cwd: Is the path to your arg file so 'app.js'

In the same dir as the read code create an app.js file with anything in it. Then change the following.

cwd: '.',
arg: [ 'app.js' ],
stdout: 'stdout.log',
stderr: 'stderr.log'

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