node.js - Restart current instance using NodeJS -


i'd restart application inside application using nodejs , npm.

it doesn't work child_process :

var exec = require('child_process').exec; exec('npm restart', function(error, stdout, stderr) {     console.log('stdout: ' + stdout);     console.log('stderr: ' + stderr);     if (error !== null) {         console.log('exec error: ' + error);     } }); 

if master process died, there no way reanimate him himself.

have @ nodemon restart script.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -