Fast fixes for common issues - Keep this bookmarked! 🚀
# 1. Check environment
npm run validate-env
# 2. Copy .env if missing
cp .env.example .env
# 3. Kill port process
kill -9 $(lsof -ti:3000)
# 4. Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install# Clear Jest cache
npx jest --clearCache
# Run with mock Stellar
MOCK_STELLAR=true npm test
# Run specific test
npx jest tests/filename.test.js# Linting issues
npm run lint:security -- --fix
# Security audit
npm audit fix
# Coverage check
npm run test:coverageAPI_KEYS=dev_key_1234567890,dev_key_abcdef123456
PORT=3000
NODE_ENV=developmentMOCK_STELLAR=true
DEBUG_MODE=false
LOG_VERBOSE=falseMOCK_STELLAR=true
DEBUG_MODE=true
LOG_VERBOSE=true
LOG_TO_FILE=truenpm test # Run all tests
npm run test:coverage # With coverage report
npm run test:coverage:ci # CI mode coverage
npm run check-coverage # Verify coverage thresholdsnpx jest tests/api.test.js
npx jest --testNamePattern="should create donation"# Health check
curl http://localhost:3000/health
# With API key
curl -H "X-API-Key: your-key" http://localhost:3000/api/v1/donations
# Check logs
tail -f logs/app.log# With Node.js inspector
node --inspect src/routes/app.js
# With ndb (install first)
ndb src/routes/app.js# Configuration
node -e "console.log(require('./src/config'))"
# Database
node -e "require('./src/utils/database').initialize().then(() => console.log('DB OK'))"
# Stellar service
node -e "console.log(require('./src/config/stellar'))"| Error | Fix |
|---|---|
EADDRINUSE :::3000 |
kill -9 $(lsof -ti:3000) |
API_KEYS is required |
Add API_KEYS=dev_key_123 to .env |
Cannot find module |
npm install |
Jest encountered unexpected token |
npx jest --clearCache |
Coverage below threshold |
Add more tests or check coverage report |
ESLint errors |
npm run lint:security -- --fix |
npm audit vulnerabilities |
npm audit fix |
.env # Environment variables
data/ # JSON data files
logs/ # Log files
src/config/ # Configuration
src/services/ # Business logic
tests/ # Test files
docs/ # Documentation
- Always use
MOCK_STELLAR=truefor development - Run
npm testlocally before pushing - Check
/healthendpoint to verify server - Use
DEBUG_MODE=truefor detailed logging - Never commit
.envfile with secrets - Clear Jest cache if tests act weird
- Check startup diagnostics for system status
# Fresh start
git clean -fd
rm -rf node_modules package-lock.json .env
cp .env.example .env
npm install
npm start- Check full troubleshooting guide
- Search GitHub Issues
- Create issue with:
- Error messages
- Environment details
- Steps to reproduce
Remember: Most issues are fixed with npm install, proper .env setup, or clearing cache! 🎉