{"record":{"id":"8bdf335fade8d2c2","repo":"screenpipe/screenpipe","slug":"screenpipe-warning-postinstall-exited-with-code","errorCode":null,"errorMessage":"screenpipe: warning: postinstall exited with code ${result.status}","messagePattern":"screenpipe: warning: postinstall exited with code (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/screenpipe/scripts/postinstall.js","lineNumber":144,"sourceCode":"  trackInstall();\n  return;\n}\n\nconst scriptPath = join(__dirname, \"postinstall.sh\");\nif (!existsSync(scriptPath)) {\n  console.warn(`screenpipe: warning: missing postinstall script at ${scriptPath}`);\n  process.exit(0);\n}\n\nconst result = spawnSync(\"sh\", [scriptPath], { stdio: \"inherit\" });\n\nif (result.error) {\n  console.warn(`screenpipe: warning: postinstall skipped: ${result.error.message}`);\n  process.exit(0);\n}\n\nif (result.status !== 0) {\n  console.warn(`screenpipe: warning: postinstall exited with code ${result.status}`);\n}\n\nprocess.exit(0);\n","sourceCodeStart":126,"sourceCodeEnd":148,"githubUrl":"https://github.com/screenpipe/screenpipe/blob/4ebf712990fee17eeaf904dacf749b6e96ac9bf3/packages/cli/screenpipe/scripts/postinstall.js#L126-L148","documentation":"This warning fires when postinstall.sh was found and spawned successfully, but the shell script exited with a non-zero status. The hook intentionally does not fail the install (`process.exit(0)` afterwards), so this surfaces script-level setup failures (platform detection, symlink/binary placement, etc.) as a warning only.","triggerScenarios":"postinstall.sh runs during `npm install`/`bun install` of the screenpipe CLI on macOS/Linux and returns non-zero: a command inside the script fails (missing required tool like curl/unzip, permission denied writing to a target path, unsupported OS/arch branch, `set -e` abort on a failed check).","commonSituations":"Minimal CI images lacking curl or other tools the script uses; read-only npm global prefixes or permission-restricted node_modules; exotic CPU/OS combinations the script's case-statement doesn't handle; script failing under `npm config set ignore-scripts false` re-runs with different env.","solutions":["Re-run the script directly to reproduce: `sh node_modules/screenpipe/scripts/postinstall.sh; echo $?` (repo: `sh packages/cli/screenpipe/scripts/postinstall.sh`) and inspect which command returns the non-zero code.","Install the missing dependency the script needs (e.g. curl, unzip) or fix filesystem permissions on the target paths it writes to.","Check the script for platform/arch branches and confirm your OS/CPU (`uname -ms`) is one it supports; if not, update the script or fall back to a manual install of the screenpipe binary.","Since the hook always exits 0, verify the CLI afterwards with `screenpipe status` and only treat the warning as blocking if that fails."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"sh node_modules/screenpipe/scripts/postinstall.sh; echo \"exit=$?\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run postinstall.sh manually after a failed install to see which command fails.","Pre-install required tools the script depends on (curl, unzip, etc.) in Docker/CI images.","Use a supported OS/arch (uname -ms) or extend the script's platform branches.","Fix write permissions for npm global prefix / node_modules before installing.","Verify with `screenpipe status` after install; the hook never fails the install itself."],"tags":["npm","postinstall","shell","exit-code"],"backgroundTag":"postinstall-script-failed","analyzedSha":"4ebf712990fee17eeaf904dacf749b6e96ac9bf3","analyzedAt":"2026-09-01T23:33:43.065Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}