diff --git a/lib/run-task.js b/lib/run-task.js index e30bb83..002b787 100644 --- a/lib/run-task.js +++ b/lib/run-task.js @@ -188,7 +188,9 @@ module.exports = function runTask (task, options) { // Attempt to figure out whether we're running via pnpm const projectRoot = path.dirname(options.packageInfo.path) const hasPnpmLockfile = fs.existsSync(path.join(projectRoot, 'pnpm-lock.yaml')) - const { status: pnpmFound, output: pnpmWhichOutput } = await which('pnpm', { nothrow: true }) + const whichPnpmResults = await which('pnpm', { nothrow: true }) + const pnpmFound = whichPnpmResults?.status + const pnpmWhichOutput = whichPnpmResults?.output if (hasPnpmLockfile && __dirname.split(path.delimiter).includes('.pnpm') && pnpmFound) { execPath = pnpmWhichOutput }