From b8b8afd4048b4ba1181e00ba2ac49ced43936ce0 Mon Sep 17 00:00:00 2001 From: vlasy Date: Mon, 18 Feb 2019 23:37:03 +0100 Subject: [PATCH] run-script: Check run script existence with undefined (#139) PR-URL: https://github.com/npm/cli/pull/139 Credit: @vlasy Reviewed-By: @zkat --- lib/run-script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run-script.js b/lib/run-script.js index 3302576311719..476591c051e73 100644 --- a/lib/run-script.js +++ b/lib/run-script.js @@ -136,7 +136,7 @@ function run (pkg, wd, cmd, args, cb) { 'prestart', 'start', 'poststart' ] } else { - if (!pkg.scripts[cmd]) { + if (pkg.scripts[cmd] == null) { if (cmd === 'test') { pkg.scripts.test = 'echo \'Error: no test specified\'' } else if (cmd === 'env') {