{"record":{"id":"af2ea20aee232df4","repo":"stablyai/orca","slug":"bin-orca-target-is-not-executable-bintarget","errorCode":null,"errorMessage":"bin.orca target is not executable: ${binTarget}","messagePattern":"bin\\.orca target is not executable: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scripts/verify-cli-bin.mjs","lineNumber":76,"sourceCode":"    if (error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') {\n      throw new Error(\n        `compiled CLI package boundary is missing: ${path.relative(projectDir, outPackageJsonPath)}`\n      )\n    }\n    throw error\n  }\n  if (outPackageJson.type !== 'commonjs') {\n    throw new Error(\n      `compiled CLI package boundary must declare type=commonjs: ${path.relative(\n        projectDir,\n        outPackageJsonPath\n      )}`\n    )\n  }\n\n  if (process.platform !== 'win32' && (stats.mode & 0o111) === 0) {\n    if (!fixExecutable) {\n      throw new Error(`bin.orca target is not executable: ${binTarget}`)\n    }\n    chmodSync(binPath, stats.mode | 0o755)\n  }\n\n  if (runHelp) {\n    execFileSync(process.execPath, [binPath, '--help'], {\n      cwd: projectDir,\n      stdio: 'ignore'\n    })\n  }\n\n  return { binPath, outPackageJsonPath, size: statSync(binPath).size }\n}\n\n/** Runs CLI verification from npm scripts and local release checks. */\nfunction main() {\n  const args = new Set(process.argv.slice(2))\n  const result = verifyPackageCliBin({","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-cli-bin.mjs#L58-L94","documentation":"On non-Windows platforms the bin target must have at least one executable bit set (mode & 0o111). The check reads stats.mode captured earlier; if no exec bit is set and --fix-executable was not passed, it throws. With --fix-executable it chmods the path to add 0o755. This guarantees the published CLI is invokable as `orca` from PATH on macOS/Linux.","triggerScenarios":"process.platform !== 'win32' AND (stats.mode & 0o111) === 0 AND fixExecutable is false, at line 74-76. Triggered when the build emits the bin without exec permission (e.g. a cp that reset mode, or a tarball extraction without --no-same-owner preserving perms).","commonSituations":"Building the CLI on one host and packaging on another where exec bits were stripped; a `cp` without -p; npm pack/unpack that normalized permissions.","solutions":["Re-run verify-cli-bin with --fix-executable so it sets the exec bits (chmod | 0o755).","Or `chmod +x <bin-path>` manually and re-run without flags.","Fix the build/packaging step to preserve the exec bit so future builds don't regress."],"exampleFix":"# before\nnode config/scripts/verify-cli-bin.mjs\n# after\nnode config/scripts/verify-cli-bin.mjs --fix-executable","handlingStrategy":"validation","validationCode":"if (process.platform !== 'win32' && (statSync(binPath).mode & 0o111) === 0) {\n  // pass --fix-executable to the verifier, or chmod here\n  chmodSync(binPath, statSync(binPath).mode | 0o755)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run verify-cli-bin --fix-executable in CI to set exec bits automatically.","Ensure packaging preserves the exec bit (use `cp -p`, tar with perms)."],"tags":["cli","packaging","permissions","unix","executable","bin"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}