vectordotdev/vector · error

Could not find at . Run `scripts/environment/prepare.sh…

Error message

Could not find {tool} at {}. Run `scripts/environment/prepare.sh --modules={tool}`.

What it means

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.

Solutions

  1. Run scripts/environment/prepare.sh --modules=<tool> to install the missing npm tool
  2. Re-run the full scripts/environment/prepare.sh if multiple modules are missing
  3. Check that scripts/environment/npm-tools/node_modules/.bin is writable and was not pruned
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at vdev/src/utils/paths.rs:107 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vectordotdev/vector@0d4ab78a4f (2026-09-16). Data as JSON: /api/errors/9cd2e37750bc096b. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/utils/paths.rs:108

        bail!(
            "{description} must resolve below the repository root: {}",
            path.display()
        );
    }

    Ok(output)
}

/// Find an npm tool installed by `scripts/environment/prepare.sh`.
pub fn npm_tool_path(repo_root: &Path, tool: &str) -> Result<PathBuf> {
    let path = repo_root
        .join("scripts/environment/npm-tools/node_modules/.bin")
        .join(tool);
    if path.is_file() {
        return Ok(path);
    }

    bail!(
        "Could not find {tool} at {}. Run `scripts/environment/prepare.sh --modules={tool}`.",
        path.display()
    )
}

pub fn prettier<T: AsRef<OsStr>>(args: impl IntoIterator<Item = T>, in_repo: bool) -> Result<()> {
    // Cached root; the cwd may have been removed by long-running commands.
    let repo_root = PathBuf::from(crate::app::path());
    let prettier = npm_tool_path(&repo_root, "prettier")?;
    let args: Vec<OsString> = [
        OsString::from("--ignore-path"),
        OsString::from(".prettierignore"),
        OsString::from("--log-level"),
        OsString::from("error"),
    ]
    .into_iter()
    .chain(args.into_iter().map(|arg| arg.as_ref().to_os_string()))
    .collect();

View on GitHub (pinned to 0d4ab78a4f)