Netlify "Deploy directory does not exist" in CI
The Netlify CLI was told to publish a directory that is not present on the runner. The build either did not run, failed, or wrote its output to a different path than the one passed with --dir.
What this error means
A netlify deploy --dir=... step fails with "Error: Deploy did not succeed: Deploy directory \"dist\" does not exist".
Error: Deploy did not succeed: Deploy directory "dist" does not existCommon causes
The build did not run or failed
The publish directory is created by the build; if the build step was skipped or errored, the directory is missing.
The --dir value does not match the build output
The framework writes to build or out, but the deploy passes --dir=dist, so the named directory is empty or absent.
How to fix it
Build first and point --dir at the real output
- Run the build step so the publish directory exists.
- Set
--dirto the directory the framework actually writes. - Confirm with
lsbefore deploying.
- run: npm run build
- run: netlify deploy --prod --dir=distSet the publish directory in netlify.toml
Define publish in netlify.toml so the CLI and dashboard agree on the output path.
[build]
command = "npm run build"
publish = "dist"How to prevent it
- Run the build before the deploy step.
- Keep
--dirin sync with the framework output directory. - Define
publishinnetlify.tomlas the single source of truth.