Troubleshooting
Solutions to common issues. Run npx forgekit-cli doctor first; it catches most environment problems in one step.
Installation Issues
npx forgekit-cli fails with "command not found"
Cause: Node.js is not installed or is below version 18.
Fix:
node --version # Must be 18.0.0 or higherInstall or upgrade Node.js from nodejs.org or via nvm:
nvm install 20
nvm use 20EACCES: permission denied when installing globally
Cause: npm's global prefix directory is owned by root, which causes permission errors when installing without sudo.
Fix: Do not use sudo npm install -g. Instead, configure npm to use a directory you own:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATHAdd the export PATH line to your ~/.bashrc or ~/.zshrc to make it permanent. Then re-run the install:
npm install -g forgekit-cliAlternatively, use nvm to manage Node.js; it installs into your home directory and avoids this problem entirely.
Node version mismatch: CLI installs but commands fail
Cause: You have multiple Node.js versions installed and the wrong one is active.
Fix: Check which Node is active and switch to 18 or 20:
node --version # Shows currently active version
nvm list # Shows all installed versions (if using nvm)
nvm use 20 # Switch to Node 20If you are not using nvm, check that your PATH points to the correct Node installation:
which nodenpx forgekit-cli hangs on first run
Cause: npm is downloading the package for the first time over a slow connection. This is normal behavior.
Fix: Wait 10–30 seconds. Subsequent runs are instant because npx caches the package locally.
Python Issues
forgekit doctor reports Python not found
Cause: Python 3 is not installed or not in your PATH.
Fix:
# macOS
brew install python3
# Ubuntu / Debian
sudo apt install python3 python3-pip
# Fedora / RHEL
sudo dnf install python3After installing, verify:
python3 --version
pip3 --versionIf python3 is available but forgekit doctor still fails, your PATH may not include the Python binary directory. Check:
which python3
echo $PATHpip install fails for api-service or ml-pipeline
Cause: Python 2's pip is being called, or pip is not installed, or the Python version is below 3.9.
Fix:
python3 --version # Must be 3.9+
pip3 --version # Must existIf pip3 is not found, install it:
python3 -m ensurepip --upgradeThen run the install explicitly:
pip3 install -r requirements.txt
# or
python3 -m pip install -r requirements.txtml-pipeline: pytest INTERNALERROR with asyncio
Cause: pytest-asyncio version conflict from MLflow or Jupyter dependencies.
Fix: Run pytest with the asyncio plugin disabled:
python -m pytest tests/ -p no:asyncioOr add this to pytest.ini in the project root:
[pytest]
testpaths = tests
asyncio_mode = autoGo Issues
go-api template: go: command not found
Cause: Go is not installed or is not in your PATH.
Fix: Install Go from go.dev/dl. The go-api template requires Go 1.21 or higher.
After installing, verify:
go versionIf Go is installed but not found, add it to your PATH:
export PATH=$PATH:/usr/local/go/binAdd this line to your ~/.bashrc or ~/.zshrc.
go-api: go mod tidy fails with network errors
Cause: The Go module proxy is unreachable (firewall or offline environment).
Fix: For offline use, set GOFLAGS to use the local module cache:
GONOSUMCHECK=* GOFLAGS=-mod=mod go build ./...Or set a local proxy if your organization runs one:
export GOPROXY=https://your-proxy.example.com,directDocker Issues
Docker is not running
Cause: Docker Desktop is installed but not started, or the Docker daemon is not running.
Fix:
docker info # Shows "Server: ERROR" if daemon is not runningStart Docker Desktop from your Applications folder (macOS) or system tray (Windows), or start the daemon on Linux:
sudo systemctl start dockerDocker is optional for scaffolding; you only need it to run docker-compose up.
Port conflict in docker-compose
Cause: Another process is already using the port that docker-compose is trying to bind (e.g., port 3000, 5432, or 8000).
Fix: Find the conflicting process and stop it:
# macOS / Linux
lsof -i :3000 # Replace 3000 with the conflicting port
kill -9 <PID>
# Or change the port in docker-compose.yml
# Example: change "3000:3000" to "3001:3000"Common port conflicts:
| Service | Default Port | Common Conflict |
|---|---|---|
web-app backend | 3000 | Another Node.js app |
api-service | 8000 | Another Python/uvicorn server |
| PostgreSQL | 5432 | Local Postgres instance |
| MLflow UI | 5000 | AirPlay on macOS |
Scaffolding Issues
Template not found: <name>
Cause: The template ID is incorrect or misspelled.
Fix: Run forgekit list to see all available template IDs:
npx forgekit-cli listAvailable templates: web-app, api-service, ml-pipeline, next-app, go-api, serverless
Error: Project directory already exists
Cause: A directory with the given project name already exists at the target path.
Fix: Choose a different name or use --dir to specify a different parent directory:
npx forgekit-cli new my-app-v2 --template web-app
# or
npx forgekit-cli new my-app --template web-app --dir ~/projectsError: ENOENT: no such file or directory during scaffold
Cause: The output directory cannot be created due to permissions.
Fix: Check that the parent directory is writable:
ls -la .If you are scaffolding into a path like ~/projects, make sure ~/projects exists:
mkdir -p ~/projectsScaffolded project has missing files
Cause: A post-scaffold install step failed partway through.
Fix: Run forgekit doctor to check your environment, then re-scaffold with --skip-install to confirm the template files themselves are intact:
npx forgekit-cli doctor
npx forgekit-cli new my-app --template web-app --skip-installIf files are present with --skip-install, the issue is in the install step. See the Python or Node issues sections above.
Test Issues
Jest test timeout: tests hang or take too long
Cause: A test is waiting on an async operation that never resolves, or the default 5-second timeout is too short for your environment.
Fix: Increase the timeout for the affected test:
it('should do something slow', async () => {
// ...
}, 30000) // 30 secondsOr set a global default in jest.config.js:
module.exports = {
testTimeout: 30000,
}If tests hang indefinitely, check for unclosed database connections, pending promises, or open server handles. Use --detectOpenHandles:
npx jest --detectOpenHandlesCoverage threshold failure: CI fails even though tests pass
Cause: Test coverage dropped below the configured threshold in jest.config.js.
Fix: Check the current coverage report to see which files are under-covered:
npm test --workspace=packages/cli -- --coverage
open packages/cli/coverage/index.htmlCurrent thresholds for src/core/**:
| Metric | Minimum |
|---|---|
| Lines | 40% |
| Functions | 33% |
| Branches | 30% |
Either add tests to bring coverage above the thresholds, or if you added new code paths that are intentionally not unit-tested (e.g., CLI command wrappers covered by integration tests), update the coveragePathIgnorePatterns in jest.config.js with justification in your PR.
CI/CD Issues
GitHub Actions workflow fails on npm ci
Cause: package-lock.json is out of sync with package.json.
Fix: Run npm install locally and commit the updated lockfile:
npm install
git add package-lock.json
git commit -s -m "chore: update lockfile"Integration test fails on api-service with ModuleNotFoundError
Cause: FastAPI or other dependencies are not installed, or the working directory is wrong.
Fix: Confirm you are running pytest from the project root where main.py lives:
cd /path/to/my-api-project
pip install -r requirements.txt
python -c "from main import app" # Verify import works
pytest tests/api-service: from main import app fails in tests
Cause: The working directory is not the project root when pytest runs.
Fix: Run pytest from the directory containing main.py:
cd my-api-project
pytest tests/VitePress Build Issues
VitePress build fails with Cannot find module errors
Cause: VitePress docs dependencies are not installed.
Fix:
cd docs
npm install
npm run buildIf running from the repo root:
npm ci
npm run docs:buildVitePress dev server crashes with EADDRINUSE
Cause: Port 5173 (the default VitePress port) is already in use.
Fix: Stop the process using that port:
lsof -i :5173
kill -9 <PID>Or start VitePress on a different port:
npx vitepress dev docs --port 5174Still stuck?
- Run
npx forgekit-cli doctorand include the full output when reporting - Search GitHub Issues
- Open a GitHub Discussion