IT Error Decoder

How to Fix Vercel: ENOENT no such file or directory

Last reviewed

Error message

Error: ENOENT: no such file or directory, open '<path>'

ENOENT errors during Vercel builds are almost always 'file isn't in the repo'. Check what's actually committed.

What this error means

The build process tried to open a file that doesn't exist on disk in the build environment.

Why this happens

File excluded by `.gitignore` or `.vercelignore`, file referenced by absolute path that only exists locally, or wrong-cased filename on Linux.

Quick fix (for end users)

  • Confirm the missing file is in your Git repo.
  • Push any new files you may have created locally but never committed.

Admin / engineer fix

  • Check what's tracked.

    command
    git ls-files | grep -i <filename>
  • Look at .gitignore and .vercelignore for patterns excluding the file.

  • Use repo-relative paths in code, not absolute paths.

    command
    // Good: path.join(process.cwd(), 'data', 'file.json')
    // Bad:  '/Users/me/project/data/file.json'

Step-by-step fix

  1. Read the failing path from the build log.

  2. Confirm it exists in Git — `git ls-files <path>`.

  3. Commit and push the missing file or fix the path.

Affected products

Vercel · Node.js

Common variations of this error

People also see these phrasings of the same problem:

  • ENOENT no such file or directory open
  • Cannot find file Vercel

Still broken? Try these

  • Linux is case-sensitive. `Data/File.json` and `data/file.json` are different files there.
  • If the file is generated, make sure it's generated *during* the build, not before.

Related errors

Related searches

  • vercel build cannot find file
  • enoent next.js build

Frequently asked questions

What does "Vercel: ENOENT no such file or directory" mean?

The build process tried to open a file that doesn't exist on disk in the build environment.

What causes "Vercel: ENOENT no such file or directory"?

File excluded by `.gitignore` or `.vercelignore`, file referenced by absolute path that only exists locally, or wrong-cased filename on Linux.

How do I fix "Vercel: ENOENT no such file or directory"?

1. Read the failing path from the build log. 2. Confirm it exists in Git — `git ls-files <path>`. 3. Commit and push the missing file or fix the path. Always test changes in a non-production environment first.

Browse more errors in Vercel: Fix Vercel deployment errors. Build failures, missing output directories, exceeded build duration, missing env vars, and module resolution issues. Or paste your own error into the error decoder tool to find a match. You can also go back to the homepage to browse common errors by topic.