Home > database >  Unable to run eslint in Next.js
Unable to run eslint in Next.js

Time:10-18

I'm trying to set up eslint on my Next.js project. I followed the guide here https://nextjs.org/docs/basic-features/eslint

When I run yarn lint, I receive the error error - ESLint must be installed.

In my "devDependencies" in package.json, I have the following:

"eslint": "^8.0.1",
"eslint-config-next": "11.1.2"

I tried running yarn add --dev eslint, but I still receive the same error after running the lint command.

Edit: This is an existing project. Was created with yarn create next-app. Versions for next and react below

"next": "^11.1.2",
"react": "^17.0.2"

Node v14.18.1

CodePudding user response:

ESLint v8 introduced breaking changes that impact compatibility with Next. Downgrading to 7.32.0 seems to work for most people.

The Next team is currently working on adding v8 support.

  • Related