Common Issues
Configuration file not found
Configuration file not found
Problem: Linkspector displays “Configuration file not found. Using default configuration.”Cause: No
.linkspector.yml file exists in your current directory, or you specified a custom config path that doesn’t exist.Solutions:-
Create a
.linkspector.ymlfile in your project root: -
If using a custom config path, verify it’s correct:
-
Use the default configuration without creating a file (checks all
.mdfiles in current directory).
The default configuration checks all Markdown files in the current directory while respecting
.gitignore rules.Git is not installed or not found
Git is not installed or not found
Problem: Error message: “Git is not installed or not found in the system path.”Cause: You have
modifiedFilesOnly: true in your configuration, but Git is not available.Solutions:-
Install Git on your system:
- macOS:
brew install git - Ubuntu/Debian:
sudo apt-get install git - Windows: Download from git-scm.com
- macOS:
-
Verify Git is in your PATH:
-
Disable
modifiedFilesOnlyif you don’t need this feature:
Empty or invalid configuration file
Empty or invalid configuration file
Problem: Error: “The configuration file is empty” or “Failed to parse the YAML content.”Cause: Your
.linkspector.yml file is empty, contains invalid YAML, or has no valid properties.Solutions:-
Check your YAML syntax is valid:
- Validate YAML syntax using an online validator or editor plugin.
-
Ensure at least
dirsorfilesis specified:
No modified files to check
No modified files to check
Problem: Message: “No modified files to check, skipping checking.”Cause: You have
modifiedFilesOnly: true enabled, but no Markdown files were changed in the last commit.Solutions:-
To check all files, set
modifiedFilesOnly: false: -
Verify your file extensions are configured correctly:
-
Check that modified files match your
dirsandfilesconfiguration.
This is not an error - it’s expected behavior when no relevant files changed.
SSL/TLS certificate errors
SSL/TLS certificate errors
Problem: Links fail with
net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH or similar SSL errors.Cause: The target website has SSL/TLS configuration issues, outdated certificates, or incompatible cipher suites.Solutions:- Verify the link works in a browser - if it doesn’t, the link is genuinely broken.
- Check if the website requires specific TLS versions or has certificate issues.
-
Add the pattern to
ignorePatternsif you need to skip it: - Contact the website owner to fix their SSL configuration.
Rate limiting or connection timeouts
Rate limiting or connection timeouts
Problem: Many links fail with timeout errors or 429 status codes (Too Many Requests).Cause: You’re checking too many links from the same domain too quickly, or the target server is slow.Solutions:
-
Use
aliveStatusCodesto treat 429 as valid if temporary: -
Check links in smaller batches:
-
Add problematic domains to
ignorePatternsfor known rate-limited sites: - Run checks during off-peak hours or less frequently.
Authentication required (401/403 errors)
Authentication required (401/403 errors)
Problem: Links return 401 Unauthorized or 403 Forbidden errors.Cause: The target URL requires authentication, but no credentials are provided.Solutions:
-
Add HTTP headers with authentication tokens:
-
Store credentials in environment variables:
-
For internal/private links, use
ignorePatterns: - Replace private links with public alternatives if available.
Environment variable substitution uses the
${VARIABLE_NAME} syntax in your config file.Relative links not resolving correctly
Relative links not resolving correctly
Problem: Relative links like
./guide.md or ../index.md are reported as broken even though they exist.Cause: Missing or incorrect baseUrl configuration, or files are not in expected locations.Solutions:-
Set a
baseUrlfor checking relative links: -
Verify file paths match your directory structure:
-
Ensure
dirsconfiguration includes all relevant directories: -
Check file extensions are included in
fileExtensions:
JSON output is malformed
JSON output is malformed
Problem: JSON output with
--json flag is not valid JSON or missing expected fields.Cause: Internal validation/fixing failed, or unexpected data structure.Solutions:-
Check stderr for validation messages:
-
Validation errors are logged to stderr while valid JSON goes to stdout:
-
Update to the latest version of Linkspector:
- Report the issue with your configuration if problem persists.
Linkspector automatically validates and fixes RDJSON output. Check stderr for details about applied fixes.
--json and --showstat cannot be used together
--json and --showstat cannot be used together
Problem: Error: “The —json and —showstat options cannot be used together.”Cause: Both output format flags were specified in the same command.Solutions:
-
Choose one output format per run:
-
Run separate commands if you need both formats:
False positives for working links
False positives for working links
Problem: Links that work in browsers are reported as broken by Linkspector.Cause: The site may be blocking automated tools, using JavaScript redirects, or has bot protection.Solutions:
- Linkspector uses Puppeteer (headless Chrome) to reduce false positives. Ensure Chrome dependencies are installed.
-
Add custom HTTP headers to mimic browser requests:
-
Configure redirect handling:
-
Add to
ignorePatternsas a last resort:
Debugging Tips
Enable Verbose Output
Check what Linkspector is processing by monitoring the spinner messages:Isolate the Problem
Test specific files to narrow down issues:Validate Configuration
Before running the full check, verify your configuration is valid:Check Git Status
If usingmodifiedFilesOnly, verify Git is working:
Test Individual Links
Use curl or browser developer tools to test specific failing links:Review Statistics
Use statistics mode to understand link distribution:Performance Optimization
Reduce scope of checks
Reduce scope of checks
Strategy: Check only necessary files
Use ignore patterns strategically
Use ignore patterns strategically
Strategy: Skip known problematic or irrelevant links
Configure alive status codes
Configure alive status codes
Strategy: Accept more status codes as valid
Respect .gitignore rules
Respect .gitignore rules
Strategy: Automatically exclude unnecessary filesThis skips checking links in files already excluded by your
.gitignore:node_modules/- Build artifacts
- Temporary files
- IDE configurations
Getting Help
If you’ve tried these solutions and still experience issues:- Check the README - Review configuration options
- Search existing issues - Someone may have encountered the same problem: GitHub Issues
-
Report a bug - Open a new issue with:
- Your
.linkspector.ymlconfiguration - Complete error message
- Linkspector version (
linkspector --version) - Operating system and Node.js version
- Your
- Ask for help - Reach out to the community or maintainers
GitHub Issues
Report bugs and request features
NPM Package
Check for updates and version history