From 7b89576bd1fa557a312a841afa66b895558d1b12 Mon Sep 17 00:00:00 2001 From: nlf Date: Fri, 13 Nov 2020 14:14:52 -0800 Subject: [PATCH] fix empty scripts PR-URL: https://github.com/npm/cli/pull/2174 Credit: @nlf Close: #2174 Reviewed-by: @ruyadorno --- 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 568a5712f6ac7..c095e6decd403 100644 --- a/lib/run-script.js +++ b/lib/run-script.js @@ -46,7 +46,7 @@ const runScript = async (args) => { pkg.scripts = scripts - if (!scripts[event] && !(event === 'start' && await isServerPackage(path))) { + if (!Object.prototype.hasOwnProperty.call(scripts, event) && !(event === 'start' && await isServerPackage(path))) { if (npm.config.get('if-present')) return