Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error - ESLint must be installed: yarn add --dev eslint #30182

Closed
skhaz opened this issue Oct 22, 2021 · 10 comments
Closed

error - ESLint must be installed: yarn add --dev eslint #30182

skhaz opened this issue Oct 22, 2021 · 10 comments
Labels
bug Issue was opened via the bug report template. Linting Related to `next lint` or ESLint with Next.js.

Comments

@skhaz
Copy link
Contributor

skhaz commented Oct 22, 2021

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

14.18.0

What browser are you using?

Chrome

What operating system are you using?

Windows WSL2

How are you deploying your application?

Vercel

Describe the Bug

I just created a new project using

npx create-next-app@latest --ts

And when I run

npm run lint

I got the error:

> next lint

info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
error - ESLint must be installed: yarn add --dev eslint

Expected Behavior

Ran without error

To Reproduce

npx create-next-app@latest --ts
cd app
npm install
npm run lint
@skhaz skhaz added the bug Issue was opened via the bug report template. label Oct 22, 2021
@sicarius97
Copy link
Contributor

#29770 Originally referenced this issue, and I saw that there was a PR opened that was intended to fix the issue here #29837. Unfortunately there still appears to be an issue when using yarn create next-app specifically. It may be fixed with create-next-app, but I haven't confirmed that yet

@sicarius97
Copy link
Contributor

I just attempted it with yarn dlx create-next-app, which also did not work. I am going to look a little further into the issue, I saw that the run lint check on first configuration got changed in the next cli package 2 days ago, and I suspect it may introduce a breaking change again. Currently the workaround is to pin a downgraded version like 7.23.0

@JeroenVanSteijn
Copy link

I have the same...

@manish-bukuwarung
Copy link

I have the same too

@manish-bukuwarung
Copy link

Please downgrade eslint version npm i -D eslint@7.32.0

may be there is some error in latest version

@timneutkens timneutkens added the Linting Related to `next lint` or ESLint with Next.js. label Oct 29, 2021
@monicavaldez
Copy link

I also experience this while using yarn instead of npx and npm

npx create-next-app@latest --ts
cd app
yarn lint

But the project runs fine (yarn dev)

@jcarpe
Copy link

jcarpe commented Nov 10, 2021

Likewise... I am having this issue but with an existing project. We recently upgraded our nextJS version and since linting was a new feature we could take advantage of, we gave it a shot! I was able to get things working with the following versions:

"next": "^11.1.2"
"eslint": "7.32.0"

@timneutkens
Copy link
Member

This has been fixed on https://github.com/vercel/next.js/releases/tag/v12.0.5-canary.0, will be out on stable soon!

@Solaimanx
Copy link

Likewise... I am having this issue but with an existing project. We recently upgraded our nextJS version and since linting was a new feature we could take advantage of, we gave it a shot! I was able to get things working with the following versions:

"next": "^11.1.2"
"eslint": "7.32.0"

Thanks . This version also working for me.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Linting Related to `next lint` or ESLint with Next.js.
Projects
None yet
Development

No branches or pull requests

8 participants