diff --git a/lib/run-task.js b/lib/run-task.js index f83be49..4a3b362 100644 --- a/lib/run-task.js +++ b/lib/run-task.js @@ -192,13 +192,15 @@ module.exports = function runTask (task, options) { } const isYarn = process.env.npm_config_user_agent && process.env.npm_config_user_agent.startsWith('yarn') + const isPnpm = Boolean(process.env.PNPM_SCRIPT_SRC_DIR) + const isNpm = !isYarn && !isPnpm const spawnArgs = ['run'] if (npmPathIsJs) { spawnArgs.unshift(npmPath) } - if (!isYarn) { + if (isNpm) { Array.prototype.push.apply(spawnArgs, options.prefixOptions) } else if (options.prefixOptions.indexOf('--silent') !== -1) { spawnArgs.push('--silent')