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
Misleading error message when recursive fs.mkdir fails with EACCES #31481
Note that the recursive: true implementation will fail in the same way with ENOENT even if the parent path does in fact exist and the syscall is failing with EACCES:
> fs.mkdirSync('/var/this', { recursive: true })
Uncaught Error: ENOENT: no such file or directory, mkdir '/var/this'
at Object.mkdirSync (fs.js:854:3) {
errno: -2,
syscall: 'mkdir',
code: 'ENOENT',
path: '/var/this'
> fs.mkdir('/var/this', { recursive: true }, console.error)
undefined
> [Error: ENOENT: no such file or directory, mkdir] {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir'
}
Activity
isaacs commentedon Jan 23, 2020
cc @bcoe
fs: recursion should bail on permission error
fs: bail on permission error in recursive directory creation
fs: return first folder made by mkdir recursive
fs: bail on permission error in recursive directory creation
fs: bail on permission error in recursive directory creation
fs: bail on permission error in recursive directory creation
fs: return first folder made by mkdir recursive
fs: return first folder made by mkdir recursive
flynnjustin24 commentedon Feb 8, 2026
flynnjustin24 commentedon Feb 8, 2026
flynnjustin24 commentedon Feb 8, 2026