fix: npm run-script fails silently. closes #2959 #2960

Closed
wants to merge 1 commit into
from
Jump to file
+4 −0
Split
View
@@ -86,6 +86,10 @@ function run (pkg, wd, cmd, cb) {
,"restart"
,"prestart","start","poststart"]
} else {
+ if (!pkg.scripts[cmd]) {
+ cb(new Error("missing script: " + cmd));
+ return;
+ }
cmds = [cmd]
}
if (!cmd.match(/^(pre|post)/)) {