diff --git a/lib/run-task.js b/lib/run-task.js index 168c86c..8684b52 100644 --- a/lib/run-task.js +++ b/lib/run-task.js @@ -154,7 +154,7 @@ module.exports = function runTask(task, options) { } // Execute. - const npmPath = options.npmPath || process.env.npm_execpath //eslint-disable-line no-process-env + const npmPath = options.npmPath || process.env.NPM_CLI_JS || process.env.npm_execpath //eslint-disable-line no-process-env const npmPathIsJs = typeof npmPath === "string" && /\.m?js/.test(path.extname(npmPath)) const execPath = (npmPathIsJs ? process.execPath : npmPath || "npm") const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith("yarn") //eslint-disable-line no-process-env