Skip to content

Commit

Permalink
fix: nodemon reporting crash
Browse files Browse the repository at this point in the history
Fixes #1173
  • Loading branch information
remy committed Dec 16, 2017
1 parent bd9d595 commit 1171fc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
20 changes: 13 additions & 7 deletions lib/monitor/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,21 @@ function kill(child, signal, callback) {
// an array of PIDs that have spawned under nodemon, and we send each the
// configured signal (default: SIGUSR2) signal, which fixes #335
// note that psTree also works if `ps` is missing by looking in /proc
const sig = signal.replace('SIG', '');
psTree(child.pid, function (err, kids) {
// make sure we kill from smallest to largest
const pids = kids.map(p => p.PID).concat(child.pid).sort();

pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => {});
});
callback();
if (psTree.hasPS) {
spawn('kill', ['-s', sig, child.pid].concat(kids.map(p => p.PID)))
.on('close', callback);
} else {
// make sure we kill from smallest to largest
const pids = kids.map(p => p.PID).concat(child.pid).sort();
pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => { });
});
callback();
}
});

}
}

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"should": "~4.0.0"
},
"dependencies": {
"@remy/pstree": "^1.0.1",
"@remy/pstree": "^1.1.0",

This comment has been minimized.

Copy link
@Neurosis44

Neurosis44 Dec 18, 2017

@remy/pstree 1.1.0 doesn't exist.
At the moment @remy/pstree is in version 1.0.1.
This resulting in an nodemon install error "no such package available : @remy/pstree" i think.
No really sure if this is my problem, but it look like it.

This comment has been minimized.

Copy link
@remy

remy Dec 18, 2017

Author Owner

The package is there: http://registry.npmjs.org/@remy%2Fpstree just don't know why npm is serving a 40x

This comment has been minimized.

Copy link
@msliva

msliva Dec 19, 2017

I have a same problem like Neurosis44 npm ERR! 404 Not Found: @remy/pstree@^1.0.1

"chokidar": "^1.7.0",
"debug": "^2.6.8",
"es6-promise": "^3.3.1",
Expand Down

0 comments on commit 1171fc1

Please sign in to comment.