{"record":{"id":"1ccc1c9fcef57ee2","repo":"oven-sh/bun","slug":"securityscannernotfound","errorCode":null,"errorMessage":"SecurityScannerNotFound","messagePattern":"SecurityScannerNotFound","errorType":"exception","errorClass":"bun_install::Error","httpStatus":null,"severity":"error","filePath":"src/install/error.rs","lineNumber":109,"sourceCode":"    #[error(\"SecurityScannerProcessFailedWithoutExitStatus\")]\n    SecurityScannerProcessFailedWithoutExitStatus,\n    #[error(\"NoSecurityScanData\")]\n    NoSecurityScanData,\n    #[error(\"InvalidIPCMessage\")]\n    InvalidIPCMessage,\n    #[error(\"InvalidIPCFormat\")]\n    InvalidIPCFormat,\n    #[error(\"MissingIPCType\")]\n    MissingIPCType,\n    #[error(\"InvalidIPCType\")]\n    InvalidIPCType,\n    #[error(\"MissingErrorCode\")]\n    MissingErrorCode,\n    #[error(\"InvalidErrorCode\")]\n    InvalidErrorCode,\n    #[error(\"UnknownErrorCode\")]\n    UnknownErrorCode,\n    #[error(\"SecurityScannerNotFound\")]\n    SecurityScannerNotFound,\n    #[error(\"SecurityScannerNotInDependencies\")]\n    SecurityScannerNotInDependencies,\n    #[error(\"InvalidScannerVersion\")]\n    InvalidScannerVersion,\n    #[error(\"ScannerFailed\")]\n    ScannerFailed,\n    #[error(\"UnknownMessageType\")]\n    UnknownMessageType,\n    #[error(\"MissingAdvisoriesField\")]\n    MissingAdvisoriesField,\n    #[error(\"SecurityScannerFailed\")]\n    SecurityScannerFailed,\n    #[error(\"SecurityScannerTerminated\")]\n    SecurityScannerTerminated,\n    #[error(\"InvalidAdvisoriesFormat\")]\n    InvalidAdvisoriesFormat,\n    #[error(\"InvalidAdvisoryFormat\")]","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/error.rs#L91-L127","documentation":"Bun's package manager could not load the security scanner configured via `security_scanner` in the `[install]` section of bunfig.toml. The scanner subprocess itself reported MODULE_NOT_FOUND on a retry attempt after Bun already tried to install it. Because the module still cannot be resolved after installation, the install-time security scan aborts.","triggerScenarios":"Set `[install] security_scanner = \"...\"` in bunfig.toml, run `bun install`, Bun attempts a partial install of the scanner package, respawns it, and the scanner process again reports code MODULE_NOT_FOUND. Two branches: a package-name scanner that failed to install correctly (security_scanner.rs:1630), or a local file path that does not exist on disk (security_scanner.rs:1637).","commonSituations":"Typos in the scanner package name or file path in bunfig.toml; a local scanner script moved or deleted; a scoped npm scanner that installed into an isolated linker layout the scanner cannot resolve; corrupt node_modules after an interrupted install; private registry auth failure so the scanner never actually downloaded.","solutions":["Verify the scanner value in bunfig.toml: for a file, confirm the path exists (ls <path>); for a package, confirm the name is published and spelled correctly","Run `bun add --dev <scanner-package>` explicitly and check it resolves (`bunx <scanner-package> --help` or require it from a script)","Delete node_modules and bun.lock, then re-run `bun install` to rebuild a clean install of the scanner","If the install itself failed, fix the underlying install error (registry auth, network, lockfile) before re-running with the scanner enabled"],"exampleFix":"# before (bunfig.toml)\n[install]\nsecurity_scanner = \"./tools/scanner.js\"   # file was moved\n\n# after\n[install]\nsecurity_scanner = \"./scripts/security-scanner.js\"  # corrected existing path","handlingStrategy":"validation","validationCode":"# before running bun install, confirm the configured scanner resolves\nSCANNER=$(grep -oP 'security_scanner\\s*=\\s*\"\\K[^\"]+' bunfig.toml)\nif [ -n \"$SCANNER\" ]; then\n  if [ -f \"$SCANNER\" ]; then : # local file exists\n  elif grep -q \"\\\"$SCANNER\\\"\" package.json; then : # declared dependency\n  else echo \"scanner '$SCANNER' missing: add it or fix the path\" >&2; exit 1; fi\nfi","typeGuard":null,"tryCatchPattern":"# in CI scripts: fail fast with context instead of a raw Bun error\nbun install || { echo \"install failed — check security_scanner config in bunfig.toml\" >&2; exit 1; }","preventionTips":["Keep the bunfig.toml security_scanner value and the devDependency entry in package.json in sync via a repo lint check","For local-file scanners, assert the file exists in a preinstall/CI step","Commit a working bunfig.toml to the repo rather than reconstructing it per machine"],"tags":["bunfig-toml","security-scanner","install","configuration"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}