question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Watchpack Error (watcher): Error: EMFILE: too many open files, watch 'some directory name'

See original GitHub issue

Bug report

Describe the bug

I am not able to successfully open localhost:3000 after running npm run dev, following the instructions of https://nextjs.org/learn/basics/create-nextjs-app/setup

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://nextjs.org/learn/basics/create-nextjs-app
  2. Follow the instructions until npm run dev
  3. At that point, Watchpack messages show in the terminal in an endless loop

Expected behavior

The expected behavior is that the server starts serving the tutorial example.

Screenshots

$ npm run dev
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog/pages'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'

...

Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog/pages'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js/nextjs-blog'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript/next_js'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms/javascript'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser/rpms'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home/myuser'
Watchpack Error (watcher): Error: EMFILE: too many open files, watch '/home'
^C

System information

  • OS: Linux Opensuse Tumbleweed
  • Browser: chrome
  • Version of Next.js: 10.0.3
  • Version of Node.js: v14.15.1
  • Deployment: Vercel

Additional context

I was following the instructions on the tutorial page of next.js.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

12reactions
lanemecommented, May 10, 2021

This issue should be reopened. This issue randomly pops up without a clue that i could use to reproduce.

0reactions
balazsorban44commented, Jan 28, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EMFILE: too many open files, watch '/' - Stack Overflow
It's been a system problem. After rebooting, it worked again as usual.
Read more >
Watchpack Error (watcher): Error: EMFILE: too many open files ...
Hi,. Unfortunately, I had to do a system update four days ago and the problem is gone. I am closing the issue. Regards....
Read more >
Watchpack Error (watcher): Error: EMFILE: too many open files
Finally, I removed the directory and recloned it from GitHub and the problem solved. grow 1. score:2. This error is because watchpack module....
Read more >
Error: EMFILE: too many open files, watch - Elixir Forum
This message gets displayed for every file in the assets directory, when starting the dev instance. If I stop other running programs, close ......
Read more >
angular/angular-cli - Gitter
Hi, I keep getting Error: EMFILE: too many open files error, even after updating the ulimit open file limit (on linux). I have...
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