{"record":{"id":"3c62e15df9e2a7de","repo":"jdx/mise","slug":"err-creating-directory-symlinks-on-windows-may","errorCode":null,"errorMessage":"{err}. Creating directory symlinks on Windows may require administrator privileges or Developer Mode","messagePattern":"(.+?)\\. Creating directory symlinks on Windows may require administrator privileges or Developer Mode","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":944,"sourceCode":"pub(crate) fn is_unc_path(path: &Path) -> bool {\n    matches!(\n        path.components().next(),\n        Some(std::path::Component::Prefix(prefix))\n            if matches!(\n                prefix.kind(),\n                std::path::Prefix::UNC(..) | std::path::Prefix::VerbatimUNC(..)\n            )\n    )\n}\n\n#[cfg(windows)]\nfn create_windows_unc_symlink(target: &Path, link: &Path) -> std::io::Result<()> {\n    std::os::windows::fs::symlink_dir(target, link).map_err(|err| {\n        if err.kind() == std::io::ErrorKind::PermissionDenied {\n            std::io::Error::new(\n                err.kind(),\n                format!(\n                    \"{err}. Creating directory symlinks on Windows may require administrator privileges or Developer Mode\"\n                ),\n            )\n        } else {\n            err\n        }\n    })\n}\n\n#[cfg(windows)]\nfn create_windows_dir_link(target: &Path, link: &Path) -> std::io::Result<()> {\n    if is_unc_path(target) {\n        create_windows_unc_symlink(target, link)\n    } else {\n        junction::create(target, link)\n    }\n}\n\n#[cfg(windows)]","sourceCodeStart":926,"sourceCodeEnd":962,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/file.rs#L926-L962","documentation":"On Windows, when mise creates a directory symlink whose target is a UNC (network) path, create_windows_unc_symlink calls std::os::windows::fs::symlink_dir. If that fails with PermissionDenied, the error is re-wrapped with this explanatory message: directory symlinks on Windows require either an elevated (administrator) process or Developer Mode enabled.","triggerScenarios":"A mise operation that symlinks a directory whose target lives on a network share (\\\\server\\share\\...) — e.g. the mise data/install directory redirected to a UNC path — while the process lacks the SeCreateSymbolicLinkPrivilege, so symlink_dir returns PermissionDenied.","commonSituations":"Corporate machines with Developer Mode disabled by policy; mise data dir or installs located on network drives; CI runners on Windows running non-elevated; fresh Windows install where Developer Mode was never turned on.","solutions":["Enable Developer Mode: Settings > System > For developers > Developer Mode (lets non-admin processes create symlinks)","Run the terminal/shell as Administrator for the operation that creates the symlink","Move the mise data directory to a local disk (MISE_DATA_DIR / MISE_CACHE_DIR) so targets are not UNC paths"],"exampleFix":"# before (PowerShell, non-admin, Developer Mode off)\nmise install node   # ...PermissionDenied: Creating directory symlinks on Windows may require administrator privileges or Developer Mode\n\n# after\nreg add 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock' /v AllowDevelopmentWithoutDevLicense /t REG_DWORD /d 1 /f\n# then retry in a new shell\nmise install node","handlingStrategy":"fallback","validationCode":"# PowerShell: check Developer Mode before mise operations that symlink\n$dev = (Get-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock' -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense\nif (-not $dev -and -not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {\n  Write-Error 'symlinks will fail: enable Developer Mode or run elevated'\n}","typeGuard":null,"tryCatchPattern":"Catch the io::Error whose message contains 'may require administrator privileges or Developer Mode'; retry once from an elevated shell, else fall back to locating data on a local drive instead of a UNC path.","preventionTips":["Enable Windows Developer Mode on developer machines by policy","Keep mise data/cache/install dirs on local NTFS volumes, not network shares","Run setup steps that create symlinks from elevated terminals"],"tags":["windows","symlink","permissions","unc","filesystem"],"backgroundTag":"symlink-permission-denied","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}