{"record":{"id":"9cd2e37750bc096b","repo":"vectordotdev/vector","slug":"could-not-find-tool-at-run-scripts-environment-prepare-sh","errorCode":null,"errorMessage":"Could not find {tool} at {}. Run `scripts/environment/prepare.sh --modules={tool}`.","messagePattern":"Could not find (.+?) at (.+?)\\. Run `scripts/environment/prepare\\.sh --modules=(.+?)`\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/utils/paths.rs","lineNumber":108,"sourceCode":"        bail!(\n            \"{description} must resolve below the repository root: {}\",\n            path.display()\n        );\n    }\n\n    Ok(output)\n}\n\n/// Find an npm tool installed by `scripts/environment/prepare.sh`.\npub fn npm_tool_path(repo_root: &Path, tool: &str) -> Result<PathBuf> {\n    let path = repo_root\n        .join(\"scripts/environment/npm-tools/node_modules/.bin\")\n        .join(tool);\n    if path.is_file() {\n        return Ok(path);\n    }\n\n    bail!(\n        \"Could not find {tool} at {}. Run `scripts/environment/prepare.sh --modules={tool}`.\",\n        path.display()\n    )\n}\n\npub fn prettier<T: AsRef<OsStr>>(args: impl IntoIterator<Item = T>, in_repo: bool) -> Result<()> {\n    // Cached root; the cwd may have been removed by long-running commands.\n    let repo_root = PathBuf::from(crate::app::path());\n    let prettier = npm_tool_path(&repo_root, \"prettier\")?;\n    let args: Vec<OsString> = [\n        OsString::from(\"--ignore-path\"),\n        OsString::from(\".prettierignore\"),\n        OsString::from(\"--log-level\"),\n        OsString::from(\"error\"),\n    ]\n    .into_iter()\n    .chain(args.into_iter().map(|arg| arg.as_ref().to_os_string()))\n    .collect();","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/vdev/src/utils/paths.rs#L90-L126","documentation":"Lookup failure in npm_tool_path: the expected binary at scripts/environment/npm-tools/node_modules/.bin/{tool} does not exist, meaning the npm-managed tool (e.g. a docs lint binary) was never installed into the repo-local node_modules tree. The error message embeds the exact missing path and the prepare.sh invocation that installs it.","triggerScenarios":"Thrown at vdev/src/utils/paths.rs:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run scripts/environment/prepare.sh --modules=<tool> to install the missing npm tool","Re-run the full scripts/environment/prepare.sh if multiple modules are missing","Check that scripts/environment/npm-tools/node_modules/.bin is writable and was not pruned"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}