Skip to content
Yash Kapure
FrontendNov 24, 20267 min readBy Yash Kapure

Engineering note

'no such directory: .../lint': Fixing next lint After Next.js 16

You upgrade to Next.js 16, run npm run lint, and get told a folder called lint is missing. There is no missing folder. The lint command is gone, and next build will not catch it for you.

A terminal showing the error Invalid project directory provided, no such directory: .../lint, after Next.js 16 removed the next lint command.
Visual referenceSource

Article focus

next lint is gone

Next.js 16 deleted the command. next build no longer runs linting either.

Key takeaways

  • 01Running next lint on Next.js 16 fails with "Invalid project directory provided, no such directory: .../lint", because lint is now a directory argument, not a command.
  • 02next build no longer runs linting. A green production build is not a linted repo.
  • 03The official fix is npx @next/codemod@canary next-lint-to-eslint-cli ., or change the script to eslint . yourself.
  • 04If you already have eslint.config.mjs, keep it and just fix the script. Put lint in CI as its own step.

The folder that was never there

You type npm run lint after a Next.js 16 upgrade and get this:

Invalid project directory provided, no such directory: /app/lint

It looks like a path typo. It is not. This site still has "lint": "next lint" in package.json, on Next.js 16.1.0. The GitHub Actions job named "Eslint, Typescript, prettier" runs that script. The command fails with that exact error.

Next.js 16 deleted next lint. The next CLI no longer has a lint command. The word lint is now the project directory argument, so next goes looking for a folder named lint, does not find one, and exits 1.

Guess what the command will do, then run it.

Guess, then run it

Pick a command, lock in a prediction, then reveal what Next.js 16.1.0 actually prints.

Next.js 16.1.0

Lock in a guess before you run the command.

Command

Your guess

$ next lint

$ next lint

Output hidden until you reveal it.

Why does next lint look for a folder called lint?

Because Next.js 16 removed the lint command. The CLI now treats lint as the optional [directory] argument used by next dev, next build and next start.

On Next 15, next lint was a real subcommand, a thin wrapper around ESLint. On Next 16, next --help does not list lint at all. I confirmed that on 16.1.0, on 24 November 2026. The upgrade guide is blunt: "The next lint command has been removed. Use Biome or ESLint directly. next build no longer runs linting."

That last sentence is the one that hides. The error is loud. The missing lint during next build is quiet.

The path below shows both sides: the broken parse, then the ESLint CLI path you want instead.

Watch lint become a folder

Step through how the Next.js CLI parses next lint after the command was removed, then flip to the ESLint path.

Two paths

Broken parse on top, ESLint CLI on the bottom. Use the chapters or flip the path.

Path

Diagram of next lint being parsed as a folder path, then the ESLint CLI path that replaces it.

package.json still says "lint": "next lint". That is the script this site runs today.

The CI step that fails, and the build that no longer lints

next build in Next.js 16 does not lint. If CI still runs next lint, that check fails with the directory error. If CI only runs next build, lint errors can ship.

Two things break at once, and they do not look related.

First, any job that still calls next lint (or npm run lint while the script still says that) fails immediately, before ESLint reads a single file. That is what the "Eslint, Typescript, prettier" check on this repo does today.

Second, next build used to run an ESLint pass. That pass is gone. A production build can go green while the lint script is dead. The official checklist even has a box for this: "Scripts and CI no longer invoke next lint; linting runs separately where the app requires it."

I already have a walkthrough of CI for a React app. The lint job is the same idea: a step that must be a real command, not a leftover script.

Flip the gates below. Put a lint error in the repo and see which jobs still catch it.

Which gate still catches a lint error?

Toggle the Next.js version, the lint script and a lint error. Watch next build and the CI lint job go green or red.

Flip the gates

Start from this site today: Next 16, the script still says next lint, CI still runs npm run lint.

Next.js

Lint script

Lint error in the repo

CI lint job

next build

Green

next build no longer lints. The production build is green even when lint is dead or the tree has errors.

CI lint job

Red

The job runs next lint and dies with the directory error, before ESLint reads a file.

The CI lint job is red, but not because of your code. It is looking for a folder named lint.

How do you fix next lint after Next.js 16?

Run the official next-lint-to-eslint-cli codemod, or change the lint script to eslint . yourself. Keep lint as its own CI step. Do not rely on next build.

The mechanical path is one command, from the official codemods page (read 24 November 2026):

bash

npx @next/codemod@canary next-lint-to-eslint-cli .
  • It rewrites `next lint` scripts to `eslint .`.
  • `--strict` becomes `--max-warnings 0`. `--dir` and `--file` become paths. `--fix` stays.
  • If there is no ESLint config, it creates an `eslint.config.mjs` with `eslint-config-next/core-web-vitals`.
  • If a flat config already exists, it keeps it and only adds Next.js rules when they are missing.

The two lines that actually matter

This site already has an eslint.config.mjs. The missing piece is the script. If that is your case too, change the two lines below by hand and read the codemod diff before you accept it.

Once the script points at ESLint, run npm run lint once. The directory error should be gone. What you get instead is real ESLint output, which is the point.

A note on next.config: the eslint key is also removed in Next 16, as the ESLint docs say. It does nothing now, and you can delete it. This site does not use that key.

json

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint --fix ."
  }
}

Services

Need help implementing this?

I build these systems for a living - let's work on yours.

Frontend Development

Production UIs in React, Next.js, or Vue- third-party and payment integrations included. Built for real traffic and maintained in production.

ReactNext.jsTypeScriptTailwind CSSshadcn/ui+5
Discuss this service

Full Stack Development

End-to-end apps: MERN, React+Node, or MEVN, plus React Native for mobile. Auth, role-based access, and real-time where it matters. Designed to scale without rewrites.

MERNMEVNNode.jsExpressReact+5
Discuss this service

Frontend Architecture & System Design

Structure so teams can ship. Clear boundaries, state strategy, and contracts. New features land cleanly; refactors stay low-risk.

TypeScriptComponent designState managementAPI contracts+4
Discuss this service

FAQ

Questions people ask

What happens when you run next lint in Next.js 16?

The command fails with "Invalid project directory provided, no such directory: .../lint". Next.js 16 removed the lint subcommand, so the CLI treats lint as a project directory argument and looks for a folder named lint.

Does next build still lint in Next.js 16?

No. The Next.js 16 upgrade guide says next build no longer runs linting. Linting has to be a separate script or CI step, usually eslint . or Biome.

How do you migrate from next lint to the ESLint CLI?

Run npx @next/codemod@canary next-lint-to-eslint-cli . or change the lint script to eslint . yourself. If you already have eslint.config.mjs, keep it and read the codemod diff before you accept it.

What does the next-lint-to-eslint-cli codemod change?

It rewrites next lint scripts to eslint ., maps --strict to --max-warnings 0, and maps --dir and --file to paths. If no ESLint config exists, it creates eslint.config.mjs with eslint-config-next/core-web-vitals. Existing flat configs are preserved.

$ git checkout --your-opinion

Your turn

  • >Did this help you ship something?
  • >Which part clicked the most for you?
  • >Applying this at work? Share your experience.

Discussion

Leave a comment

Thoughts, questions, corrections - all welcome.

Sign in with GitHub to comment - free & takes 10 seconds

Continue

More engineering notes

View all notes
Illustration of React reconciliation: two virtual DOM trees being diffed with changes highlighted, and the resulting minimal set of DOM mutations applied to the real DOM.
Frontend
18 min readMay 3, 2026

How React Knows What to Re-render: The Reconciliation & Diffing Algorithm

Learn React's reconciliation algorithm: virtual DOM diffing, key prop rules, render vs commit phases, React 18 batching, and concurrent rendering - from first principles to production patterns.

Developers working on laptops together at a workspace
AI
18 min readApr 12, 2026

The Ultimate Guide to Free AI API Keys: 6 Platforms You Need to Know

Free AI API keys from OpenRouter, Groq, Google AI Studio, NVIDIA Build, GitHub Models, and Cloudflare Workers AI - rate limits, working provider combos, and key hygiene explained.

Subscribe for new posts, or read how referrals and sponsored placements are handled on this site.