Free auditStart free
GuideError · CDN and hosting errors

Netlify build failed

Diagnose a failed Netlify build from the deploy log: exit status 128, command not found, peer dependency errors, Node version, case sensitivity and cache.

4 min
read
3
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

A failed Netlify build almost always comes from a difference between your machine and Netlify's build environment. Build locally first, then match package and Node.js versions, check the base directory, and read the deploy log for the exact message: exit status 128 means Netlify cannot clone the repo, and command not found means the toolchain config file is missing.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode

At a glance

4 facts from the sources below
Deploy log
Where errors show
Package version mismatch
Leading cause per docs
Retry without cache
Retry option
exit status 128
Clone failure
01Messages and symptoms from Netlify's guide

Match the message to the cause

Netlify's troubleshooting guide begins with a rule: build locally first, then match package versions, since it names a mismatch between the versions on your machine and the ones Netlify uses as the leading cause of build failure. The deploy log is the record of everything in the build and deploy, including errors, so the exact string in it picks the row below.
What you see

jekyll: command not found or gulp: command not found

Cause
The toolchain is not installed
Fix
Add the right config file (Gemfile for Ruby, package.json for Node) in the base directory
What you see

Could not resolve dependency or Conflicting peer dependency

Cause
npm peer dependency conflict, mainly React 17+ on Node 16.5.1+
Fix
Set NPM_FLAGS to --force or --legacy-peer-deps
What you see

exit status 128

Cause
Netlify lacks permission to clone the repository, usually after org or repo settings changed
Fix
Relink the repository
What you see

Fails only on Netlify; works on macOS or Windows

Cause
Linux is case-sensitive, so jQuery/jquery.js and jquery/jquery.js differ
Fix
Rename with git mv or git rm, then re-add
What you see

Build fails on a warning

Cause
CI=true makes some libraries treat warnings as errors
Fix
Run the build as CI='' npm run build
What you see

Deploy fails with large files

Cause
Files over 10 MB may fail to upload
Fix
Host the large content elsewhere
What you see

Uncaught SyntaxError: Unexpected token in the browser

Cause
A reference to an asset that no longer exists, often hashed filenames or code splitting across atomic deploys
Fix
Disable hashed filenames, use permalinks, or use a service worker
02How it works

Reproduce it before you retry

  1. 1

    Mimic the CI flag

    Netlify builds with CI=true. Run your build command with it on so warnings-as-errors show up locally.

  2. 2

    Start from a clean install

    Delete node_modules and install from the lockfile, so you test what a fresh build environment gets.

  3. 3

    Match Node.js

    Use the version you set for Netlify (next section). With the Netlify CLI, Netlify says a mismatch between your local Node.js and the one on Netlify can cause errors.

  4. 4

    Check case

    Imports that differ from file names only by case work on macOS and Windows and fail on Netlify's Linux build.

Reader's own project: a clean local build with the CI flag set
rm -rf node_modules
npm install
CI=true npm run build
echo "exit code: $?"
Reader's own repo: list files whose names differ only by case
git ls-files | sort -f | uniq -di

Both commands need your own repository. The second prints nothing when no two tracked paths collide once case is ignored, and prints the colliding names otherwise.

05Explained

Effect on crawlers

A failed build is not a response a crawler can see. What matters is what the domain serves afterward: a wrong publish directory yields 404s, and Google removes URLs already indexed that return 4xx. Once the build is fixed, request the key URLs and check status codes, and see Netlify function timeouts for the runtime side of the same platform.

Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01What does Netlify exit status 128 mean?

Netlify does not have permission to clone the repository. It usually follows a change to org or repo settings after the site was linked. Relink the repository and check for duplicate webhooks.

02Why does my build pass locally and fail on Netlify?

The common differences are package versions, Node.js version, a case-sensitive Linux filesystem and the CI flag turning warnings into errors. Netlify names mismatched package versions as the leading cause.

03How do I set the Node version on Netlify?

Set a NODE_VERSION environment variable, or add a .nvmrc or .node-version file to the base directory. Either overrides the version chosen in the UI.

Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • netlify.com
  • google.com
  1. 01Netlify docs: Troubleshooting tips for buildsdocs.netlify.com · checked 2026-11-01
  2. 02Netlify docs: Manage dependenciesdocs.netlify.com · checked 2026-11-01
  3. 03How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane