You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EACCES when renaming folder that is being watched from nodejs #3395
I am trying to use chokidar, a popular nodejs file system watcher library.
Whenever I use chokidar to listen for file system changes, I can no longer rename folders that lie within the folder being watched.
npm install chokidar
mkdir test
echo hello > test/test.txt
create repro.js:
varfs=require('fs');varchokidar=require('chokidar');// Watch current directory and ignore the node_modules folderchokidar.watch('.',{ignored: /node_modules/}).on('all',(event,path)=>{console.log(event,path);});// After sufficient time, attempt to rename the test folder// Note: this is also reproducible using `mv` on the command linesetTimeout(function(){fs.rename('test','test2',function(err){if(err){console.log(err);}else{console.log('rename ok');}});},1000);
WSL (Ubuntu 18.04):
Ubuntu 18.04:
I don't think it is terribly important (other colleagues are able to reproduce with other node versions), but I am using nodejs v8.11.3
Reacted by Tuomas Tanner, Jorge Orpinel and Matti Schmidt
I don't think it is terribly important (other colleagues are able to reproduce with other node versions)
Nah it's a manifestation of about the most pervasive bug around here (if you don't count 0xhexdigits fail at startup). Call this dupe #1956 but you can pick any dating back to #14.
changed the title [-]EACCESS when renaming folder that is being watched from nodejs[/-][+]EACCES when renaming folder that is being watched from nodejs[/+]on Jul 22, 2018
Reacted by Ahmad Raza, Aiman Farhan, Digo Ribeiro, Derek Lewis, Vitor L Cavalcanti, patrik, COPIUMcodes, Abdul Aziz Al Basyir, PeakLu, Yuriy Lyubchenko and 12 more
Reacted by Abdul Aziz Al Basyir, Adam Mescher, Renier de Bruyn, Adi Fahmi, Frederik Jørgensen and Slava Chan
Reacted by Angel Almario, Adam Mescher, Frederik Jørgensen and Slava Chan
Reacted by Derek Lewis, Abdul Aziz Al Basyir, Adam Mescher, Renier de Bruyn, Frederik Jørgensen and Slava Chan
This is pretty annoying... for now I just close VS code since the file watcher has a lock on the files, do file work in terminal or file explorer and reopen when done with code . in ubuntu.
Otherwise, unless there is a reason to not upgrade to WSL 2 I would suggest anybody does so.
Hello,
I know the issue is closed but summarizing the full steps. I got the what but was not able to get how of it from this chat.
I am using WSL1 with Docker Desktop
File -> Preferences -> Settings
Click on the Open Settings(JSON) button on top right corner and change this "remote.WSL.fileWatcher.polling": true.
Activity
therealkenc commentedon Jul 20, 2018
Nah it's a manifestation of about the most pervasive bug around here (if you don't count 0xhexdigits fail at startup). Call this dupe #1956 but you can pick any dating back to #14.
[-]EACCESS when renaming folder that is being watched from nodejs[/-][+]EACCES when renaming folder that is being watched from nodejs[/+]qwabra commentedon May 20, 2020
this does not work for me
code.visualstudio.com/docs
but this is helped
95th commentedon May 21, 2020
qwabra I tried your approach and even that doesn't work.
I tried:
then
then both.
None of this works for me.
Can anyone please help?
JordanSimba commentedon Jun 14, 2020
This is pretty annoying... for now I just close VS code since the file watcher has a lock on the files, do file work in terminal or file explorer and reopen when done with
code .in ubuntu.Otherwise, unless there is a reason to not upgrade to WSL 2 I would suggest anybody does so.
DerekNonGeneric commentedon Jul 2, 2020
Why is the workaround from #3395 (comment) not explicitly stated in the VS Code docs section about known WSL limitations? It should note that all workspace files must be excluded from being watched otherwise the problem will persist…
qwabra commentedon Jul 13, 2020
you can just open
settings.jsonand switch triggerfalse/truein"**/*": falseit can be set locally
(use workspace settings)
.vscode/settings.jsonsee docs
Spongman commentedon Jul 31, 2020
something is fundamentally broken here. while having my remote-wsl workspace open in vscode, i get the following in a command prompt:
that means the windows kernel has every single one of the files in my workspace open.
i have the following in my
settings.json:byteroll commentedon Sep 12, 2020
Thank you. This also solved my problem in installing go tools on WSL.
SanjivG10 commentedon Sep 27, 2020
// settings.json (located in %appdata%/code/user/settings.json)
{
"files.watcherExclude": {
"//*": true
}
}
After saving it, restart VsCode.
Merge pull request #1386 from aantron/eacces
asimarora commentedon Jan 29, 2024
Hello,
I know the issue is closed but summarizing the full steps. I got the what but was not able to get how of it from this chat.
I am using WSL1 with Docker Desktop
File -> Preferences -> Settings
Click on the Open Settings(JSON) button on top right corner and change this "remote.WSL.fileWatcher.polling": true.
Hope I am not repeating someone else answer :)
554948671 commentedon Feb 24, 2026
تعليقات