{"record":{"id":"17a0d3f6a193a446","repo":"can1357/oh-my-pi","slug":"source-deps-install-failed-runargv-0-exit-r","errorCode":null,"errorMessage":"source deps install failed (${runArgv[0]} exit ${r.status})","messagePattern":"source deps install failed \\((.+?) exit (.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/runner.ts","lineNumber":1157,"sourceCode":"\t\t\t\t: [\n\t\t\t\t\t\t\"docker\",\n\t\t\t\t\t\t\"run\",\n\t\t\t\t\t\t\"--rm\",\n\t\t\t\t\t\t\"--platform\",\n\t\t\t\t\t\t`linux/${arch === \"x64\" ? \"amd64\" : \"arm64\"}`,\n\t\t\t\t\t\t\"-e\",\n\t\t\t\t\t\t\"HOME=/tmp\",\n\t\t\t\t\t\t\"-v\",\n\t\t\t\t\t\t`${depsDir}:/deps`,\n\t\t\t\t\t\timage,\n\t\t\t\t\t\t\"sh\",\n\t\t\t\t\t\t\"-c\",\n\t\t\t\t\t\tscript,\n\t\t\t\t\t];\n\t\tconst r = spawnSync(runArgv[0], runArgv.slice(1), { stdio: [\"ignore\", \"inherit\", \"inherit\"] });\n\t\tif (r.status !== 0) {\n\t\t\tfs.rmSync(stampFile, { force: true });\n\t\t\tthrow new Error(`source deps install failed (${runArgv[0]} exit ${r.status})`);\n\t\t}\n\t\tfs.writeFileSync(stampFile, `${stamp}\\n`);\n\t}\n\tif (!fs.existsSync(path.join(depsDir, \"node_modules\"))) {\n\t\tthrow new Error(`source deps tree has no node_modules (${depsDir}); delete it and retry`);\n\t}\n\t// Shadow-mount every node_modules visible in the host tree (they hold darwin\n\t// binaries) with the skeleton's linux one; both sides of each mount must exist.\n\tconst nodeModules = [\"node_modules\"];\n\tfor (const dir of pkgDirs) {\n\t\tconst rel = path.join(dir, \"node_modules\");\n\t\tconst inHost = fs.existsSync(path.join(REPO_ROOT, rel));\n\t\tconst inDeps = fs.existsSync(path.join(depsDir, rel));\n\t\tif (!inHost && !inDeps) continue;\n\t\tif (!inDeps) fs.mkdirSync(path.join(depsDir, rel), { recursive: true });\n\t\tif (!inHost) fs.mkdirSync(path.join(REPO_ROOT, rel), { recursive: true });\n\t\tnodeModules.push(rel);\n\t}","sourceCodeStart":1139,"sourceCodeEnd":1175,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/runner.ts#L1139-L1175","documentation":"The runner installs source dependencies into a cached deps dir via a shell script (the package manager command in runArgv). When the spawned process exits non-zero, the stamp file is removed so the install is retried next run, and this error is thrown naming the executable and its exit code. stdout/stderr are inherited, so the real failure reason appears directly above this message in the terminal.","triggerScenarios":"`runArgv[0]` (e.g. bun/npm install script) exits non-zero while populating the source deps tree — network failure during install, unresolved dependency versions, or a broken lockfile/package.json in the skeleton.","commonSituations":"Offline or proxied network blocking registry access; a dependency added to package.json with no resolvable version; package-manager authentication failures for private registries; disk full during install.","solutions":["Scroll up to the inherited output from the install command to see the underlying failure and fix it","Re-run the install manually in the deps dir to reproduce interactively","Check network/registry access (corporate proxy, NPM_TOKEN) and retry","Clear the deps dir entirely so a fresh install is attempted"],"exampleFix":"// before: transient registry failure\nsource deps install failed (bun exit 1)\n// after: retry with network healthy\n$ bun install --cwd <depsDir>\n# rerun the harness; stamp regenerates on success","handlingStrategy":"retry","validationCode":"const probe = Bun.spawnSync([\"bun\", \"install\", \"--dry-run\"], { cwd: depsDir });\nif (probe.exitCode !== 0) throw new Error(\"deps install would fail; check package.json/lockfile and network first\");","typeGuard":null,"tryCatchPattern":"try {\n  await runHarness();\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"source deps install failed\")) {\n    // stdout/stderr were inherited: inspect the real cause printed above, then retry\n    console.error(\"Install subprocess failed; fix the printed cause (network/lockfile) and rerun.\");\n  } else throw err;\n}","preventionTips":["Ensure registry access and auth tokens (NPM_TOKEN) are set in the environment","Commit a consistent lockfile so installs are reproducible","Retry once on transient network errors before surfacing failure","Monitor disk space; full disks fail installs mid-way"],"tags":["dependencies","install","subprocess"],"backgroundTag":"dependency-install-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}