Skip to content

Commit 2aa197b

Browse files
coreyfarrellrefack
authored andcommitted
doc: fs.mkdir('/') throws EPERM on Windows
Fixes: nodejs#25110 PR-URL: nodejs#25340 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ben Coe <[email protected]>
1 parent 734e482 commit 2aa197b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/api/fs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,15 @@ fs.mkdir('/tmp/a/apple', { recursive: true }, (err) => {
22122212
});
22132213
```
22142214

2215+
On Windows, using `fs.mkdir()` on the root directory even with recursion will
2216+
result in an error:
2217+
2218+
```js
2219+
fs.mkdir('/', { recursive: true }, (err) => {
2220+
// => [Error: EPERM: operation not permitted, mkdir 'C:\']
2221+
});
2222+
```
2223+
22152224
See also: mkdir(2).
22162225

22172226
## fs.mkdirSync(path[, options])

0 commit comments

Comments
 (0)