chokidar icon indicating copy to clipboard operation
chokidar copied to clipboard

Error: EPERM: operation not permitted, rename

Open mkloar opened this issue 3 years ago • 4 comments

Describe the bug

When trying to rename the folder someProject, @config, configuration chokidar waits at least 10sec and then report an error: 'Error: EPERM: operation not permitted: rename'

Folder structure:

.
+-- configuration
|   +-- @config-someConfig
|        +-- someProject
|          +-- document
|             +-- someDocument.txt

Versions:

  • Chokidar version ^3.4.2
  • Node version: v12.16.1
  • OS version: Windows 10

To Reproduce:

const chokidar = require('chokidar');

const watcher = chokidar.watch('./configuration/@config-*/**/*.*', {
    ignorePermissionErrors: true
});

watcher
   .on('add', path => console.log(`File ${path} has been added`))
  .on('change', path =>  console.log(`File ${path} has been changed`))
  .on('unlink', path =>  console.log(`File ${path} has been removed`))
  .on('addDir', path =>  console.log(`Directory ${path} has been added`))
  .on('unlinkDir', path =>  console.log(`Directory ${path} has been removed`))
  .on('error', error =>  console.log(`Watcher error: ${error}`))
  .on('ready', () =>  console.log('Initial scan complete. Ready for changes'))
  .on('raw', (event, path, details) => { // internal
    console.log('Raw event info:', event, path, details);
  });

Expected behavior Chokidar should rename the folder.

mkloar avatar Aug 12 '20 10:08 mkloar

Can add that It only happens when you try to rename folder that contains at least one nested folder.

thers avatar Mar 13 '21 06:03 thers

I meet the problem too. Set usePolling to true on win32 fixes my problem.

BUPT-HJM avatar May 08 '21 12:05 BUPT-HJM

Same here

stoefln avatar Jan 13 '22 08:01 stoefln

Also, this one makes impossible to rename directories inside vscode on windows, which has some content in it.

jakerdy avatar Sep 29 '23 17:09 jakerdy