Closed
Description
- Version: v8.9.4
- Platform: Windows 10, 64-bit, build 17083 (Windows Insider Preview). In developer mode (so normal users can create symlinks).
- Subsystem: fs
Using fs.symlinkSync( x, y, 'dir' )
to create a directory symlink is failing (EPERM: operation not permitted), while mklink /d
is able to make the symlink.
Simplest example to demonstrate the issue:
C:\Users\me\AppData\Local\Temp>node
> require('fs').symlinkSync('abcdef', 'ghijkl', 'dir')
Error: EPERM: operation not permitted, symlink 'abcdef' -> 'C:\Users\me\AppData\Local\Temp\ghijkl'
at Object.fs.symlinkSync (fs.js:1014:18)
File symlinks are fine; it’s only directory symlinks that are failing. It doesn’t matter whether the target path exists or not, it fails with the same EPERM error.
Meanwhile,
C:\Users\me\AppData\Local\Temp>mklink /d ghijkl abcdef
symbolic link created for ghijkl <<===>> abcdef