Couldn't find a `pages` directory. Please create one under the project root
See original GitHub issueI noticed that when I add files: []
in package.json
, the following error appears:
Couldn’t find a
pages
directory. Please create one under the project root
Is this a bug?
If not, it would be great to document this.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Error Couldn't find a `pages` directory. Please create one ...
config.js and tsconfig.json should be inside the root directory, moving them to src won't work. Same goes for the public directory. Move ...
Read more >Getting `Couldn't find a `pages` directory. Please create one ...
Please create one under the project root . It works well again after rolling back to Next.js 9.0.6. Deployed files and folders: .next;...
Read more >[Solved]-Error Couldn't find a `pages` directory. Please create ...
Coding example for the question Error Couldn't find a `pages` directory. Please create one under the project root"-Reactjs.
Read more >Advanced Features: `src` Directory - Next.js
Save pages under the `src` directory as an alternative to the root ... The src directory is very common in many apps and...
Read more >Is the next.js pages folder required? | by Rajdeep singh | Nextjs
In the nextjs pages, the pagesfolder is required that is true. But if you have an old reactjs-based project, you convert it into...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i have same issue using next.js in docker. how to resolve it ?
This is not a bug. What’s happening is your files are not included in the project. See: https://docs.npmjs.com/files/package.json#files
So, use the
files
wisely or remove it.