Netlify troubleshooting

Fix Netlify Build Command Failed

Netlify build failures often come from the wrong base directory, missing environment variables, or a publish directory mismatch. Verify settings before changing app code.

Common symptoms

  • Netlify exits with build.command failed.
  • The build cannot find package.json.
  • Deploy succeeds but the site is blank or 404.

What to check first

Platform: Netlify
Error: Build command failed

Netlify build failures often come from the wrong base directory, missing environment variables, or a publish directory mismatch. Verify settings before changing app code.

Step-by-step fix

  1. Check Site configuration ? Build & deploy for Base directory, Build command, and Publish directory.
  2. If the app is in a subfolder, set the base directory instead of running commands from the repo root.
  3. Set environment variables in Netlify and trigger a new deploy.
  4. Match the publish directory to your framework output, such as dist for Vite or build for some React apps.
# netlify.toml example
[build]
  base = "app"
  command = "npm run build"
  publish = "dist"

Common mistake to avoid

Do not set publish to the source folder unless your framework actually outputs static files there.

Still stuck?

Send the deploy log, repository link, target platform, and expected URL. ShipFast Deploy Rescue is a fixed-price debugging service for indie projects and MVPs.