Troubleshooting Guide
Comprehensive solutions for common issues and errors in ManageX
Table of Contents
Installation Issues
Node.js Not Found
Symptoms: Command node --version returns "command not found"
Solutions:
- Verify Node.js is installed: Download from nodejs.org
- Check if Node.js is in PATH:
echo $PATH
- Restart your terminal/command prompt after installation
- On Windows: Restart your computer if PATH changes don't take effect
npm Command Not Found
Symptoms: Command npm --version returns "command not found"
Solutions:
- npm comes bundled with Node.js - reinstall Node.js if npm is missing
- Verify npm installation:
npm --version
- Update npm to latest version:
npm install -g npm@latest
MySQL Not Installed or Not Running
Symptoms: Database connection errors, "ECONNREFUSED"
Solutions:
- Windows: Check Services (services.msc) - MySQL service should be running
- Linux: Check service status:
sudo systemctl status mysql
- macOS: Check if MySQL is running:
brew services list
- Start MySQL service if stopped
Database Connection Problems
Error: "Access denied for user"
Symptoms: Authentication failed when connecting to MySQL
Solutions:
- Verify credentials in
server/.envfile match your MySQL setup - Check username and password are correct (no extra spaces)
- Test connection manually:
mysql -u root -p
- Reset MySQL root password if forgotten (platform-specific instructions)
Error: "Unknown database"
Symptoms: Error: "Unknown database 'managex_db'"
Solutions:
- Create the database manually:
mysql -u root -p CREATE DATABASE managex_db;
- Or update
DB_NAMEin.envto match an existing database - Verify database exists:
SHOW DATABASES;
Error: "Can't connect to MySQL server"
Symptoms: Connection timeout or refused
Solutions:
- Verify MySQL service is running (see Installation Issues above)
- Check
DB_HOSTin.env- should belocalhostfor local installations - Verify
DB_PORT- default is3306 - Check firewall settings if using remote MySQL server
- Test connection:
mysql -h localhost -P 3306 -u root -p
Important
Always ensure your .env file has correct database credentials.
Double-check for typos, extra spaces, or missing values.
Migration Errors
Error: "Migration failed"
Symptoms: npm run db:migrate fails with errors
Solutions:
- Ensure database exists and is accessible
- Check database user has CREATE, ALTER, and DROP permissions
- Verify MySQL is running
- Check migration status:
npm run db:migrate:status
- Review error messages for specific table/column issues
Error: "Table already exists"
Symptoms: Migration tries to create tables that already exist
Solutions:
- Check migration status to see which migrations have run
- If starting fresh, drop and recreate database:
DROP DATABASE managex_db; CREATE DATABASE managex_db;
- Or undo all migrations and re-run:
npm run db:migrate:undo:all npm run db:migrate
Error: "SequelizeConnectionError"
Symptoms: Cannot connect to database during migration
Solutions:
- Verify database connection settings in
.env - Ensure MySQL service is running
- Test connection manually (see Database Connection Problems)
- Check
config/config.jsis reading environment variables correctly
Seeder Issues
Error: "Seeder failed"
Symptoms: npm run demo fails with errors
Solutions:
- Ensure migrations have completed successfully first
- Verify
IS_DEMOis set correctly in.env(0 or 1) - Check that required tables exist:
SHOW TABLES;
- Review error messages for specific seeder issues
- Some seeders depend on others - ensure they run in order
Error: "Foreign key constraint fails"
Symptoms: Seeder fails due to missing referenced records
Solutions:
- Ensure all prerequisite seeders have run (organization, roles, etc.)
- Run seeders in correct order - use
npm run demowhich handles order - If manually running seeders, check dependencies
- Verify parent records exist before creating child records
IS_DEMO Configuration Issues
Symptoms: Wrong seeders running or demo data missing
Solutions:
- Check
IS_DEMOvalue in.env:IS_DEMO=0- Runs only non-demo seeders (production)IS_DEMO=1- Runs all seeders including demo data
- Ensure no spaces around the equals sign:
IS_DEMO=0notIS_DEMO = 0 - Restart terminal/command prompt after changing
.env - Verify the value is being read correctly by checking console output
Note
The npm run demo command automatically reads IS_DEMO from your .env file.
Make sure the file is saved and the value is correct before running the command.
Server Startup Problems
Error: "Cannot find module"
Symptoms: Server fails to start with module not found errors
Solutions:
- Install dependencies:
cd server npm install
- Delete
node_modulesandpackage-lock.json, then reinstall:rm -rf node_modules package-lock.json npm install
- Verify you're in the correct directory (server folder)
Error: "EADDRINUSE" or Port Already in Use
Symptoms: Server cannot start because port is occupied
Solutions:
- Change PORT in
.envto an available port (e.g., 3001, 3002) - Or kill the process using the port (see Port Conflicts section below)
Error: "JWT_SECRET is not defined"
Symptoms: Server fails with JWT secret errors
Solutions:
- Ensure
JWT_SECRETis set inserver/.env - Verify no syntax errors in
.envfile - Check for missing quotes or special characters
- Restart server after updating
.env
Server Starts But Shows Errors
Symptoms: Server runs but displays warnings or errors in console
Solutions:
- Check error messages for specific issues
- Verify all environment variables are set correctly
- Check database connection is working
- Review server logs for detailed error information
Port Conflicts
Finding Process Using a Port (Windows)
netstat -ano | findstr :3000
This shows the PID (Process ID) of the process using port 3000.
Killing Process on Windows
taskkill /PID <PID> /F
Replace <PID> with the actual Process ID from the previous command.
Finding Process Using a Port (Linux/macOS)
lsof -i :3000
Or using netstat:
netstat -tulpn | grep :3000
Killing Process on Linux/macOS
kill -9 <PID>
Replace <PID> with the actual Process ID.
Alternative Solution
Instead of killing processes, you can simply change the PORT in your .env file
to use a different port (e.g., 3001, 3002, 8080).
Permission Errors
Permission Denied on Windows
Symptoms: "Access is denied" or "Permission denied" errors
Solutions:
- Run Command Prompt or PowerShell as Administrator:
- Right-click on Command Prompt/PowerShell
- Select "Run as administrator"
- For file operations, ensure you have write permissions in the project directory
- Check Windows User Account Control (UAC) settings
Permission Denied on Linux/macOS
Symptoms: "Permission denied" or "EACCES" errors
Solutions:
- Use
sudofor system-level operations (use with caution) - Fix file permissions:
chmod -R 755 server
- Change ownership if needed:
sudo chown -R $USER:$USER server
- Avoid running npm install with sudo (can cause permission issues)
Database Permission Errors
Symptoms: Cannot create database, tables, or execute migrations
Solutions:
- Ensure database user has necessary permissions:
GRANT ALL PRIVILEGES ON managex_db.* TO 'username'@'localhost'; FLUSH PRIVILEGES;
- Or use root user for development (not recommended for production)
- Verify user can connect and create objects
Dependency Issues
npm install Fails
Symptoms: Errors during npm install
Solutions:
- Clear npm cache:
npm cache clean --force
- Delete
node_modulesandpackage-lock.json:rm -rf node_modules package-lock.json
- Reinstall dependencies:
npm install
- Update npm to latest version:
npm install -g npm@latest
- Check Node.js version compatibility (Node 16+ required)
Module Version Conflicts
Symptoms: Warnings about peer dependencies or version mismatches
Solutions:
- Update all dependencies:
npm update
- Check for outdated packages:
npm outdated
- Review package.json for version constraints
- Most warnings are non-critical - test if application still works
Native Module Compilation Errors
Symptoms: Errors about building native modules (bcrypt, etc.)
Solutions:
- Windows: Install Windows Build Tools:
npm install -g windows-build-tools
- Linux: Install build essentials:
sudo apt-get install build-essential
- macOS: Install Xcode Command Line Tools:
xcode-select --install
Verification Steps
Complete System Check
Follow these steps to verify your installation is working correctly:
1. Verify Prerequisites
# Check Node.js version (should be 16+) node --version # Check npm version (should be 8+) npm --version # Check MySQL version mysql --version
2. Verify Database
# Connect to MySQL mysql -u root -p # Check database exists SHOW DATABASES; # Use your database USE managex_db; # Check tables exist SHOW TABLES; # Exit MySQL EXIT;
3. Verify Environment Configuration
Check that server/.env file exists and contains:
- Database configuration (DB_HOST, DB_NAME, DB_USERNAME, DB_PASSWORD)
- JWT secrets (JWT_SECRET, JWT_REFRESH_SECRET)
- Port configuration (PORT)
- IS_DEMO setting
4. Verify Dependencies
# Navigate to server directory cd server # Check node_modules exists ls node_modules # Verify key packages npm list express sequelize mysql2
5. Verify Server Startup
# Start server npm run dev # Should see: # Server running on port 3000 (or your configured port) # Database connected successfully
6. Verify Application Access
- Open browser and navigate to
http://localhost:3000 - Should see login page
- Login with default credentials:
- Email:
superadmin@managex.com - Password:
SuperAdmin@123
- Email:
Success Indicators
If all verification steps pass, your ManageX installation is working correctly! You should be able to access the application and start configuring your organization.
Still Need Help?
If you've tried all the solutions above and still encounter issues:
- Review error messages carefully - they often contain specific clues
- Check the application logs for detailed error information
- Verify all prerequisites are installed and up to date
- Ensure you're following the setup guide for your operating system
- Check that your system meets the minimum requirements
Documentation
For more information, refer to:
- Home - Overview and quick start guide
- Windows Setup - Windows-specific installation
- Linux Setup - Linux-specific installation
- macOS Setup - macOS-specific installation