Closed yuchiXiong closed 8 months ago
I've noted the same thing.
My use case was to determine if a file in the snapshot exists or not.
Instead of using fs.promises.access I solved this by using the following code:
let exists = false;
try {
await fs.promises.stat(filePath);
exists = true;
} catch (error) {
logger.verbose(`File does not exist: ${filePath}`);
}
logger.verbose(`File exists: ${exists}`);
facing same issue with fs.promises.opendir
What version of pkg are you using?
5.8.1
What version of Node.js are you using?
v16.20.2
What operating system are you using?
Windows 10 22H2 (19045.3570)
What CPU architecture are you using?
AMD64
What Node versions, OSs and CPU architectures are you building for?
node16-win-x64
Describe the Bug
A tool library I'm using uses the
fs.promises.access
API.When the argument is the address of a file located in /snapshot, it always throws the following error:
I was looking through the issues list and noticed that a similar issue had appeared in the past with the
fs.promises.stat
API, which worked fine in my code, but thefs.promises.access
API still had the same issue.Here is the simple code I used to reproduce the problem and it works fine in Node.
Expected Behavior
It should work fine like the
fs.promises.stat
API.To Reproduce
src/app.js
package.json
then…… run it