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
On Windows a SIMLOCK_HOME directly under a drive root fails every command with EPERM mkdir #1663
On Windows, a SIMLOCK_HOME that sits directly under a drive root makes every command that starts the daemon fail:
> $env:SIMLOCK_HOME = 'D:\simlock-verify'
> simlock doctor
{"error":{"code":"INTERNAL","message":"EPERM: operation not permitted, mkdir 'D:\\'"}}
D:\sv\home (one level deeper) works. Seen on Windows 11 23H2, Node 22.23.5, main at c9d82e3.
Why
createDataDirectory (src/ports/daemon-launcher.ts:93) first runs mkdir(dirname(directory), { recursive: true }). For D:\simlock-verify that is mkdir('D:\\', { recursive: true }), and Node on Windows rejects a recursive mkdir of a drive root with EPERM even though it exists (node -e "require('fs').promises.mkdir('D:\\\\',{recursive:true})" → EPERM). The same call on POSIX for / succeeds.
A data folder on a second drive is a likely Windows setup: the device copies are several GB each.
Expected
A SIMLOCK_HOME such as D:\simlock works. Other mkdirp calls on a path whose parent is a drive root may have the same problem.
Confirmed on Windows 11, Node 22.23.5, at cc22e32. Windows refuses mkdir of a drive root whether or not it is recursive; a folder under the root is fine:
> node probe: mkdir('D:\\', {recursive}) / mkdir('D:\\simlock1663t-probe', {recursive}) / mkdir('D:\\')
EPERM D:\ ok D:\simlock1663t-probe nonrec EPERM
> set SIMLOCK_HOME=D:\simlock1663t && node dist\cli\main.js doctor
{"error":{"code":"INTERNAL","message":"EPERM: operation not permitted, mkdir 'D:\\'"}}
The test on bug/1663-repro runs everywhere: a temporary folder stands in for the drive root, and a mocked mkdir refuses it with EPERM.
src/ports/daemon-launcher.test.ts › "starts the daemon when the folder holding SIMLOCK_HOME exists but refuses mkdir"
pnpm exec vitest run --project unit src/ports/daemon-launcher.test.ts
AssertionError: promise rejected "Error: EPERM: operation not permitted, mk… { code: '…' }" instead of resolving
❯ createDataDirectory src/ports/daemon-launcher.ts:94:9
Root cause
Defect. createDataDirectory (src/ports/daemon-launcher.ts:94) always runs mkdir(dirname(directory), { recursive: true }), even when the parent already exists. When SIMLOCK_HOME sits directly under a drive root, that parent is the root, and Windows refuses it. The issue's diagnosis is right.
Activity
V3RON commentedon Nov 17, 2026
Reproduction
Confirmed on Windows 11, Node 22.23.5, at cc22e32. Windows refuses
mkdirof a drive root whether or not it is recursive; a folder under the root is fine:The test on
bug/1663-reproruns everywhere: a temporary folder stands in for the drive root, and a mockedmkdirrefuses it with EPERM.src/ports/daemon-launcher.test.ts› "starts the daemon when the folder holding SIMLOCK_HOME exists but refuses mkdir"Root cause
Defect.
createDataDirectory(src/ports/daemon-launcher.ts:94) always runsmkdir(dirname(directory), { recursive: true }), even when the parent already exists. WhenSIMLOCK_HOMEsits directly under a drive root, that parent is the root, and Windows refuses it. The issue's diagnosis is right.Simplest fix
Create the parent only when it is missing:
Alternatives rejected
dirname(parent) === parent: special-cases roots; a stat covers every parent that exists.Risk
mkdir(directory)'s ENOTDIR, where it used to be the recursive mkdir's EEXIST.mkdirpfails only when asked for the root itself.Fast track
Written by an agent.
V3RON commentedon Nov 17, 2026
Delivery run
Merged: #1672 (#1663)
Parked: none
Waiting: none
Decided: none
Written by an agent.