Next.js Discord

Discord Forum

Pages directory cannot be found [ESLint Error]

Unanswered
Yellow and black potter wasp posted this in #help-forum
Open in Discord
Yellow and black potter waspOP
## Situation

I am developing a Next.js-based project using App Router. I am using ESLint, but I am getting an error message that the Pages directory cannot be found. I do not have a 'pages' directory myself because I am using App Router. How can I solve this problem?

## What I tried to solve the problem
URL : https://github.com/vercel/next.js/issues/47047

I tried the above method, but I don't think it's a fundamental solution because it just turns off lint itself. This is because an error should be displayed if a link using the <a> tag is used in a component within the app directory.

## Error Message:

Pages directory cannot be found at C:\Users\computer\Desktop\myProject\pages or C:\Users\computer\Desktop\myProject\src\pages. If using a custom path, please configure with theno-html-link-for-pagesrule in your eslint config file.

## Environment Versions:

OS Platform: Windows 11
IDE: VS Code 1.90.0

eslint: 8.57.0
eslint-config-next: 14.2.3

3 Replies

Netherland Dwarf
May i ask how did you set your your next.js project?
Using the npm install command and you selected the app router option as mentioned in the docs?
@Netherland Dwarf Using the npm install command and you selected the app router option as mentioned in the docs?
Yellow and black potter waspOP
Yes,

I followed the official Next.js documentation to set up my project, which can be found at https://nextjs.org/docs/getting-started/installation

As you mentioned, I also selected the app router option during the setup process