尝试重命名文件夹someProject
,@config-someConfig
,configuration
时,chokidar等待至少10秒,然后报告错误:“错误:EPERM:不允许操作:重命名” >
文件夹结构:
.
+-- configuration
| +-- @config-someConfig
| +-- someProject
| +-- document
| +-- someDocument.txt
版本:
Chokidar版本^ 3.4.2
节点版本:v12.16.1
chokidar代码:
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);
});