{"record":{"id":"477ab99817438d20","repo":"stablyai/orca","slug":"npm-execpath-is-required-run-this-harness-through","errorCode":null,"errorMessage":"npm_execpath is required; run this harness through pnpm","messagePattern":"npm_execpath is required; run this harness through pnpm","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-ssh-docker-bulk-open-freeze-e2e.mjs","lineNumber":6,"sourceCode":"import { spawnSync } from 'node:child_process'\n\nconst extraArgs = process.argv.slice(2)\nconst pnpmEntry = process.env.npm_execpath\nif (!pnpmEntry) {\n  throw new Error('npm_execpath is required; run this harness through pnpm')\n}\nconst env = {\n  ...process.env,\n  ORCA_E2E_SSH_DOCKER: '1'\n}\n\nconst runtime = spawnSync(process.execPath, [pnpmEntry, 'run', 'ensure:electron-runtime'], {\n  stdio: 'inherit',\n  env\n})\n\nif (runtime.status !== 0) {\n  process.exit(runtime.status ?? 1)\n}\n\nconst result = spawnSync(\n  process.execPath,\n  [","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-ssh-docker-bulk-open-freeze-e2e.mjs#L1-L24","documentation":"Thrown at the top of run-ssh-docker-bulk-open-freeze-e2e.mjs because the harness shells out to pnpm (via process.env.npm_execpath) to run ensure:electron-runtime. pnpm sets npm_execpath to its CLI entry; bare node or npx does not. The guard prevents a half-initialized run where the electron runtime probe never executes.","triggerScenarios":"Executing the script directly with node config/scripts/run-ssh-docker-bulk-open-freeze-e2e.mjs, or via npm/yarn instead of pnpm, so npm_execpath is undefined.","commonSituations":"A developer runs node on the script during debugging; CI invokes it through a non-pnpm task runner; a shell wrapper stripped the npm_* env vars; pnpm was bypassed via npx.","solutions":["Invoke through pnpm: pnpm run test:e2e:ssh-docker-bulk-open-freeze (or the package.json script that wraps this harness).","If you must invoke node directly for debugging, set npm_execpath first: export npm_execpath=$(pnpm which pnpm) — but prefer the pnpm task.","Verify the calling CI step uses pnpm run, not npm run or a direct node call."],"exampleFix":"// before\nnode config/scripts/run-ssh-docker-bulk-open-freeze-e2e.mjs\n// after\npnpm run test:e2e:ssh-docker-bulk-open-freeze","handlingStrategy":"validation","validationCode":"// assert the harness is being driven by pnpm\nif (!process.env.npm_execpath || !process.env.npm_execpath.includes('pnpm')) {\n  console.error('Run via pnpm: pnpm run test:e2e:ssh-docker-bulk-open-freeze')\n  process.exit(1)\n}","typeGuard":"function isPnpmEnv(env: NodeJS.ProcessEnv): boolean {\n  return typeof env.npm_execpath === 'string' && /pnpm(\\.cjs)?$/.test(env.npm_execpath)\n}","tryCatchPattern":null,"preventionTips":["Wrap the harness in a package.json script so callers always go through pnpm run.","Document the pnpm-only requirement in the script's header comment.","In CI, assert pnpm --version in the same step before the test command."],"tags":["env","pnpm","e2e","test-runner"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}