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

many to many - Django Rest Framework ManyToMany filter multiple values -

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

Java Entity Manager - JSON reader was expecting a value but found 'db' -