Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/...'
See original GitHub issueI 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:
- Created 3 years ago
- Reactions:58
- Comments:81 (12 by maintainers)

Top Related StackOverflow Question
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’
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.