FarazShuja
FarazShuja

Reputation: 2370

error: Forever detected script exited with code: 0

I have a simple script to watch change in file, index.js

var watch = require('node-watch');

watch('C:\CRM\log.txt', function(filename) {
  console.log(filename, ' changed.');
});

I am trying to run it via command

forever start index.js

Its showing output:

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info:    Forever processing file: index.js

and the control is returning to command prompt, instead of staying there! How can I keep it running and get the console.log output as soon as file is changed?

Upvotes: 1

Views: 1292

Answers (1)

bbrown
bbrown

Reputation: 6360

forever start index.js will start up in the background. From the sounds of it, you want it to stay in the foreground. Use forever index.js instead.

Upvotes: 2

Related Questions