# 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.

Canonical: https://scaplet.com/errors/cdn/netlify-build-failed

Guide Error · CDN and hosting errors

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fnetlify-build-failed%20(%22Netlify%20build%20failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fnetlify-build-failed%20(%22Netlify%20build%20failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fnetlify-build-failed%20(%22Netlify%20build%20failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fcdn%2Fnetlify-build-failed%20(%22Netlify%20build%20failed%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## 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

_01_Messages 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](/glossary/service-worker)

**Warnings do not fail the build**Redirect or custom header rules that cannot be processed are listed near the end of the build log and in the Deploy Summary, but Netlify says they do not fail the build.

_02_How 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.

_03_Package manager detection from the dependency docs

## Pin Node.js and the package manager

A build's Node.js version starts as the default on the site's build image, and Netlify pins the site to that version so builds do not change when the image's defaults change. Three overrides exist, and per Netlify the environment variable, `.node-version` file and `.nvmrc` file all beat the UI setting.

Manager

### npm (default)

Detected by

No `yarn.lock`, `pnpm-lock.yaml` or `bun.lockb`

Runs

`npm install`

Manager

### pnpm

Detected by

`pnpm-lock.yaml` in the base directory, Node.js 16.9.0 or newer

Runs

`pnpm install`

Manager

### Yarn

Detected by

`yarn.lock`, or a `packageManager` field naming Yarn

Runs

`yarn`

Manager

### Bun

Detected by

`bun.lockb` committed to the repo

Runs

`bun install`

.nvmrc in the site's base directory: major version 22 means the latest 22.x

```
22
```

Two details that cause real failures: Yarn Berry (2.0.0 and later) needs `nodeLinker: node-modules` in `.yarnrc.yml` because Plug'n'Play is not supported, and the `packageManager` field takes an exact version such as `pnpm@6.3.2`, not a semver range.

_04_Which cache each deploy loads

## Relink the repository and clear the cache

For `exit status 128`, go to **Project configuration**, **Developer settings**, **Continuous deployment**, **Repository**, choose **Manage repository**, then **Link to a different repository**. Afterward check your Git provider for duplicate Netlify webhooks.

Deploy type

### Production branch deploy

Cache loaded

Production branch cache only

Deploy type

### Branch deploy

Cache loaded

Branch-specific cache, falling back to the production cache

Deploy type

### Deploy Preview

Cache loaded

Cache tied to the pull or merge request, falling back to production

To clear a stale build cache, redeploy the latest branch commit with **Retry without cache**. Cache scope depends on the deploy type, which explains why a branch deploy can behave differently from production.

If the build is not failing but the deployed site shows Page not found, Netlify points at the publish directory. Open **Configuration**, **Developer settings**, **Build settings** and confirm it. Retries after post-processing failures are exhausted after 4 attempts, at which point the guide says to contact support.

_05_Explained

## 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](/errors/cdn/netlify-function-timeout) for the runtime side of the same platform.

Questions

## Asked a lot.

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

_01_ What 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.

_02_ Why 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.

_03_ How 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. 01 [Netlify docs: Troubleshooting tips for builds](https://docs.netlify.com/build/configure-builds/troubleshooting-tips/) docs.netlify.com · checked 2026-11-01
2. 02 [Netlify docs: Manage dependencies](https://docs.netlify.com/build/configure-builds/manage-dependencies/) docs.netlify.com · checked 2026-11-01
3. 03 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

## Keep learning

[All errors](/errors)

[Learn Vercel build failed CDN and hosting errors](/errors/cdn/vercel-build-failed) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next 404 Not Found HTTP status codes](/errors/http/404) [Do Run a free site audit Free, about two minutes](/site-audit)

More Netlify errors
[Netlify function timeout](/errors/cdn/netlify-function-timeout)

Nearby in errors
[AWS Lambda timeout](/errors/cdn/lambda-timeout)

More in CDN and hosting errors
[Cloudflare verify you are human loop](/errors/cdn/cloudflare-verify-you-are-human-loop) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [CloudFront 404 Not Found](/errors/cdn/cloudfront-404) [CloudFront 503: Service Unavailable](/errors/cdn/cloudfront-503) [Firebase Hosting 404](/errors/cdn/firebase-hosting-404) [GitHub Pages 404 Not Found](/errors/cdn/github-pages-404) [Google Cloud 502 Bad Gateway](/errors/cdn/google-cloud-502) [Heroku 503 Service Unavailable](/errors/cdn/heroku-503) [Heroku H10: App crashed](/errors/cdn/heroku-h10-app-crashed) [Heroku H12: Request timeout](/errors/cdn/heroku-h12-request-timeout) [Heroku H13: Connection closed without response](/errors/cdn/heroku-h13) [Heroku H14: No web processes running](/errors/cdn/heroku-h14) [Netlify build failed](/errors/cdn/netlify-build-failed) [Netlify function timeout](/errors/cdn/netlify-function-timeout) [Render 502 Bad Gateway](/errors/cdn/render-502) [S3 Access Denied (403 Forbidden)](/errors/cdn/s3-access-denied) [Vercel 413: FUNCTION_PAYLOAD_TOO_LARGE](/errors/cdn/vercel-payload-too-large) [Vercel 429: Too Many Requests](/errors/cdn/vercel-429) [Vercel 500: Internal Server Error](/errors/cdn/vercel-500) [Vercel build failed](/errors/cdn/vercel-build-failed) [Vercel domain not working](/errors/cdn/vercel-domain-not-working) [Vercel FUNCTION_INVOCATION_TIMEOUT](/errors/cdn/vercel-function-invocation-timeout) [Vercel: too many redirects](/errors/cdn/vercel-too-many-redirects) [Akamai reference number](/errors/cdn/akamai-reference-number)

Terms on this page
[Service worker](/glossary/service-worker)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
