Troubleshooting
Solutions to common issues with libragen
This guide covers common issues and their solutions when using libragen.
Installation Issues
npx command not found
Cause: Node.js is not installed or not in your PATH.
Solution:
- Install Node.js 24+ from nodejs.org
- Verify installation:
node --version - Restart your terminal
Permission errors on install
Cause: npm global directory requires elevated permissions.
Solution:
# Option 1: Use npx (no global install needed)libragen build ./docs --name my-docs
# Option 2: Fix npm permissionsmkdir ~/.npm-globalnpm config set prefix '~/.npm-global'echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrcsource ~/.bashrcBuild Issues
Build is slow on first run
Cause: The embedding model (~50MB) must be downloaded on first use.
Solution: This is expected. Subsequent builds will be faster as the model is cached in ~/.libragen/models/ (or $LIBRAGEN_MODEL_CACHE).
Out of memory errors
Cause: Processing too many large files at once.
Solutions:
- Reduce chunk size:
--chunk-size 256 - Exclude large files:
--exclude "**/*.pdf" --exclude "**/images/**" - Process directories separately and combine results
- Increase Node.js memory:
NODE_OPTIONS="--max-old-space-size=4096" libragen build ...
No chunks created
Cause: No supported files found, or all files excluded.
Solutions:
- Check file extensions - only
.md,.txt,.html,.mdxare processed by default - Add custom extensions:
--extensions ".rst,.adoc" - Check exclude patterns aren’t too broad
- Verify source path is correct
”ENOENT: no such file or directory”
Cause: Source path doesn’t exist or is inaccessible.
Solutions:
- Verify the path exists:
ls ./docs - Use absolute path if relative path fails
- Check file permissions
Query Issues
No results returned
Cause: Query doesn’t match indexed content, or library is empty.
Solutions:
- Check library has content:
libragen inspect my-library.libragen - Try broader search terms
- Use keywords that appear in your docs
- Rebuild with smaller chunk size for more granular results
Poor quality results
Cause: Chunks are too large/small, or content isn’t well-structured.
Solutions:
- Adjust chunk size (see Building Libraries)
- Ensure source docs have clear headings and sections
- Try different query phrasing
- Rebuild library after improving source documentation structure
”Library not found”
Cause: Library file doesn’t exist at the expected path.
Solutions:
- Check library exists:
libragen list - Verify library path:
libragen config - Use full path:
libragen query --library /path/to/my-lib.libragen "query" - Check
LIBRAGEN_HOMEenvironment variable
MCP Issues
MCP server not loading
Cause: Configuration syntax error or server not installed.
Solutions:
- Verify JSON syntax in config file
- Reinstall:
npx -y install-mcp @libragen/mcp - Check
npxis in your PATH - Restart your AI tool completely (not just the chat)
“No libraries found” in MCP
Cause: Libraries not in the default directory.
Solutions:
- Check library location:
libragen config - Install libraries to default location:
libragen install my-lib.libragen - Set custom path in MCP config:
{ "mcpServers": { "libragen": { "command": "npx", "args": ["-y", "@libragen/mcp"], "env": { "LIBRAGEN_HOME": "/path/to/your/libragen" } } }}MCP queries are slow
Cause: First query downloads the embedding model.
Solution: First query takes 10-30 seconds to download the model. Subsequent queries should be fast (<1 second).
AI tool not using libragen
Cause: Tool not configured to use MCP, or server not registered.
Solutions:
- Verify MCP is enabled in your AI tool’s settings
- Check server appears in tool’s MCP server list
- Explicitly ask the AI to “search my libragen libraries for…”
- Restart the AI tool after config changes
Library Management
”Library already installed”
Cause: A library with the same name already exists.
Solution: Use --force to overwrite:
libragen install my-lib.libragen --forceCan’t uninstall library
Cause: Library is referenced by a collection, or file doesn’t exist.
Solutions:
- Uninstall the collection first:
libragen collection uninstall <collection> - Manually delete the file from the library directory
- Check library location:
libragen config
Library file is corrupted
Cause: Incomplete download or disk error.
Solutions:
- Delete and rebuild:
rm my-lib.libragen && libragen build ... - Re-download from collection:
libragen install my-lib --force - Verify file integrity with
libragen inspect my-lib.libragen
Platform-Specific Issues
macOS: “operation not permitted”
Cause: macOS security restrictions.
Solutions:
- Grant Terminal full disk access in System Preferences → Privacy & Security
- Run from a different directory (outside ~/Desktop, ~/Documents)
Windows: Path too long
Cause: Windows path length limits.
Solutions:
- Enable long paths in Windows (requires admin)
- Use shorter directory names
- Move project closer to drive root
Linux: Missing dependencies
Cause: System libraries required for native modules.
Solution:
# Debian/Ubuntusudo apt-get install build-essential python3
# RHEL/CentOSsudo yum groupinstall "Development Tools"Getting Help
If you’re still stuck:
- Check version:
libragen --cli-version(ensure you’re on the latest) - View config:
libragen config(verify paths are correct) - Verbose output: Add
--verboseto commands for more details - GitHub Issues: Report a bug