Couldn't find a `pages` directory. Please create one under the project root

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
tokracommented, Jul 22, 2017

i have same issue using next.js in docker. how to resolve it ?

3reactions
arunodacommented, Jun 6, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found