Mintplex-Labs/anything-llm · error · Error
@vscode/ripgrep not installed
Error message
@vscode/ripgrep not installed
What it means
Thrown by searchFilesWithRipgrepGlob() when require("@vscode/ripgrep") throws, meaning the package is not installed or not resolvable from the current module path. The filesystem search feature depends on this package to locate the ripgrep (rg) binary for fast file listing. The error is a synchronous require failure caught by a try/catch.
Source
Thrown at server/utils/agents/aibitat/plugins/filesystem/search-files.js:270
},
};
/**
* Search for files by glob pattern using ripgrep (fast file listing).
* @returns {{ files: string[], method: string }}
*/
function searchFilesWithRipgrepGlob({
searchPath,
patterns,
excludePatterns = [],
maxResults = 100,
}) {
const { spawnSync } = require("child_process");
let rgPath;
try {
({ rgPath } = require("@vscode/ripgrep"));
} catch {
throw new Error("@vscode/ripgrep not installed");
}
// Build ripgrep arguments for file listing
const args = [
"--files", // List files instead of searching content
"--no-ignore", // Search all files, even those in .gitignore
];
// Add glob patterns (ripgrep uses --glob for filtering --files output)
for (const pattern of patterns) args.push("--glob", pattern);
for (const exclude of excludePatterns) args.push("--glob", `!${exclude}`);
// The "--" prevents searchPath from being parsed as an option if it starts with "-"
// (defense against argument injection attacks)
args.push("--", searchPath);
const result = spawnSync(rgPath, args, {
encoding: "utf-8",
maxBuffer: 10 * 1024 * 1024,View on GitHub (pinned to 526360e320)
Solutions
- Run a full npm install (without --ignore-scripts) so @vscode/ripgrep's postinstall downloads the binary.
- Verify the package is present: check node_modules/@vscode/ripgrep and that rg binary exists under its bin.
- If scripts are blocked by policy, pre-install the rg binary and make it resolvable, or allow the postinstall.
- Reinstall the package specifically: npm install @vscode/ripgrep.
Defensive patterns
Strategy: fallback
Validate before calling
// detect the dependency before relying on ripgrep-based search
function hasRipgrep() {
try { require("@vscode/ripgrep"); return true; } catch { return false; }
}
if (!hasRipgrep()) throw new Error("@vscode/ripgrep missing; run npm install"); Try / catch
try {
results = searchFilesWithRipgrepGlob({ searchPath, patterns });
} catch (e) {
if (e.message === "@vscode/ripgrep not installed") {
// fall back to a recursive readdir-based search or install the package
} else throw e;
} Prevention
- Run a full npm install without --ignore-scripts so the ripgrep postinstall runs.
- Verify node_modules/@vscode/ripgrep and its rg binary exist after install.
- In CI/production, do not prune @vscode/ripgrep or skip its postinstall.
When it happens
Trigger: The @vscode/ripgrep package is absent from node_modules, its postinstall script (which downloads the platform-specific rg binary) failed or was skipped, or a monorepo/hoisting setup moved the package where this module cannot resolve it.
Common situations: A fresh or partial npm install that did not run postinstall; CI with --ignore-scripts that skips the binary download; a production deploy that pruned devDependencies incorrectly; a pnpm/yarn hoisting layout the require cannot follow.
Related errors
- Could not find exact match for edit:\n${edit.oldText}
- ${result.stderr || `ripgrep exited with code ${result.status
- Failed to load pdf-parse. Please install it with eg. `npm in
- FFMPEG candidate path not found.
- FFMPEG binary not found.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/3430cba014589eb6.
Report an issue: GitHub.