In case there is a folder in the same directory as the cache file, then this folder is accessed as a file which lead to the ugly error above.
Easy workaround: put all cache files into their own folder.
This happens when the cleanup function is triggered.
readFile (node_modules\node-persist\src\local-storage.js:302)
fs.readdir (node_modules\node-persist\src\local-storage.js:286)
[ async function ] (Unknown Source:undefined)
fs.readdir (node_modules\node-persist\src\local-storage.js:278)
(anonymous function) (fs.js:135)
[ FSREQWRAP ] (Unknown Source:undefined)
init (inspector_async_hook.js:22)
emitInitNative (async_hooks.js:131)
fs.readdir (fs.js:897)
fs.exists (node_modules\node-persist\src\local-storage.js:278)
cb (fs.js:312)
[ FSREQWRAP ] (Unknown Source:undefined)
init (inspector_async_hook.js:22)
emitInitNative (async_hooks.js:131)
fs.exists (fs.js:310)
Promise (node_modules\node-persist\src\local-storage.js:275)
readDirectory (node_modules\node-persist\src\local-storage.js:273)
data (node_modules\node-persist\src\local-storage.js:116)
keys (node_modules\node-persist\src\local-storage.js:120)
removeExpiredItems (node_modules\node-persist\src\local-storage.js:238)