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 (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/...'

See original GitHub issue

I run webpack --watch --watch-options-stdin ... and amidst its initial build (not the subsequent builds triggered by changed files), it prints:

Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/DumpStack.log.tmp'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/hiberfil.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/pagefile.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/swapfile.sys'

Someone already reported the problem here, so I’ll refer to those details for reproduction. Key elements are webpack v5 and WSL1 under Windows.

The directory /mnt/c maps to the Windows root drive C:\, which contains these special files like the swapfile, to which the user doesn’t have access. That is, the command ls /mnt/c fails on the command line too. So it’s not surprising that it fails for watchpack too.

What is surprising (to me) is that watchpack attempts to list that directory to begin with. I have no config telling webpack/watchpack what to watch, only that --watch flag. Can someone explain this to me?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:58
  • Comments:81 (12 by maintainers)

github_iconTop GitHub Comments

55reactions
TravelFiendcommented, Apr 1, 2021

Plus another, also with WSL2 + Windows 10

Watchpack Error (initial scan): Error: EACCES: permission denied, lstat ‘/mnt/c/DumpStack.log.tmp’ Watchpack Error (initial scan): Error: EACCES: permission denied, lstat ‘/mnt/c/hiberfil.sys’ Watchpack Error (initial scan): Error: EACCES: permission denied, lstat ‘/mnt/c/pagefile.sys’ Watchpack Error (initial scan): Error: EACCES: permission denied, lstat ‘/mnt/c/swapfile.sys’

51reactions
gadgetcrawfordcommented, May 27, 2021

Just do what I did. I completely removed Windows, replaced it with Linux. No more WSL, no more Microsoft. I am able to solve most issues, but WSL is not true Linux. Life is so much easier now. As for Lieutu, It isn’t so arbitrary. You should get your facts straight before you add your input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EACCES: permission denied, lstat '/mnt/c/DumpStack ...
But get the following error. Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/DumpStack.log.tmp' Watchpack Error ...
Read more >
Error: EACCES: permission denied, lstat '/mnt/c/...'
I run webpack --watch --watch-options-stdin ... and amidst its initial build (not the subsequent builds triggered by changed files), ...
Read more >
Watchpack error when use npm run dev on next app - Reddit
I created my nextjs app via create-next-app But when I am trying to launch it i got the following error : ready -...
Read more >
Watchpack error when trying to watch root directory
... watch '/data/data' Watchpack Error (watcher): Error: EACCES: permission denied, watch '/data' Watchpack Error (initial scan): Error: ...
Read more >
Error: EACCES: permission denied, lstat '/mnt/c/というエラー
Next.jsのプロジェクトで、next devを実行するとWatchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/・・の ...
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