MoltBot Troubleshooting: Fix Common Errors, Crashes & API Issues
The ultimate dictionary for MoltBot errors. Fix npm install failures, Port 3000 conflicts, Invalid API keys, and white screen issues.
MoltBot Troubleshooting Dictionary
Stuck with an error? Use Ctrl+F (or Cmd+F) to search for your specific error code on this page.
🛑 Installation Errors (npm install)
The most common issues happen during the initial setup.
1. gyp: No Xcode or CLT version detected
Symptoms:
- Installation fails while building
better-sqlite3orsharp. - Error log contains:
node-gyp rebuildfailed. - Error log contains:
python: not found.
Solution (Mac):
Your Mac is missing the build tools required to compile native modules.
xcode-select --installIf that doesn't work, verify Python is installed:
python3 --versionSolution (Windows):
You need Windows Build Tools. Run this in PowerShell as Administrator:
npm install --global --production windows-build-tools2. EACCES: permission denied
Symptoms:
Error: EACCES: permission denied, mkdir ...- You are trying to run
npm installwithout permissions.
Solution:
⚠️ Never use
sudo npm install. It causes more permission issues later.
Instead, fix your npm permissions globally or use a version manager like nvm (recommended).
Quick Fix:
# Change ownership of your npm directories
sudo chown -R $USER:$(id -gn $USER) ~/.config
sudo chown -R $USER:$(id -gn $USER) ~/.npm3. npm ERR! code ERESOLVE (Dependency Conflict)
Symptoms:
npm ERR! code ERESOLVEnpm ERR! ERESOLVE could not resolve
Solution:
This happens when dependency versions conflict. Force npm to ignore strict peer dependencies:
npm install --legacy-peer-deps🔌 Runtime Errors (npm start)
1. Port 3000 Already in Use (EADDRINUSE)
Symptoms:
Error: listen EADDRINUSE: address already in use :::3000- MoltBot crashes immediately after starting.
Solution A: Kill the blocking process
Mac/Linux:
lsof -i :3000
# Take note of the PID (e.g., 12345)
kill -9 <PID>Windows (PowerShell):
netstat -ano | findstr :3000
taskkill /PID <PID> /FSolution B: Change the Port
You don't have to use port 3000. Start MoltBot on port 3001 or 8080:
# Linux/Mac
PORT=3001 npm run start
# Windows (PowerShell)
$env:PORT="3001"; npm run start2. Module Not Found / Crashes
Symptoms:
Error: Cannot find module 'sharp'Error: Cannot find module 'better-sqlite3'
Solution:
This usually means a binary failed to download or compile.
# 1. Delete existing modules
rm -rf node_modules package-lock.json
# 2. Reinstall (try specifically for your architecture)
npm install --platform=darwin --arch=arm64 sharp # For Apple Silicon
npm install🔑 API Key & Connectivity Issues
1. 401 Unauthorized / Invalid Key
Symptoms:
Error: Invalid API key- Bot replies with empty messages or "I cannot help with that".
Solution:
Check for Spaces: A very common mistake is pasting the key with a space at the end.
# ❌ WRONG
OPENAI_API_KEY=sk-123456
# ✅ CORRECT
OPENAI_API_KEY=sk-123456Restart Required: If you edited .env, you must stop (Ctrl+C) and restart the server (npm run start) for changes to apply.
2. 429 Too Many Requests (Insufficient Quota)
Symptoms:
Error: 429 You exceeded your current quotaError: Insufficient funds
Solution:
This is not a bug in MoltBot.
- OpenAI: Check your billing dashboard. Do you have credits? (Trial credits expire).
- Anthropic: You must add a credit card and pre-load at least $5 to use the API via code, even if the web chat is free.
🪟 Windows (WSL2) Specific Issues
1. Can't Access localhost:3000
Symptoms:
- MoltBot says "Server running on port 3000".
- Browser shows "This site can't be reached".
Solution:
WSL2 sometimes doesn't map localhost correctly.
- Try accessing via IP:
http://127.0.0.1:3000 - Find your WSL IP address:
hostname -I- Use that IP in your browser (e.g.,
http://172.x.x.x:3000).
🐛 Still Stuck? How to View Logs
If your error isn't listed here, you need to see the full crash log.
- Check the Terminal: Scroll up in the window where you ran
npm start. - Check the Browser Console:
- Right-click the webpage → Inspect.
- Go to the Console tab.
- Screenshot any red errors and search specifically for those lines.
Need more help?
Try searching the Official GitHub Issues with your specific error message.