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
Error: dsh: C:\Users\<user>\.dsh\profiles\node_modules\@deepseek-ai\dsh exists and is not a symlink; remove it so dsh can manage the installation fallback
if(stat!==undefined){letisLink=stat.isSymbolicLink()letcurrentTarget: string|null=nullif(isLink){currentTarget=readlinkSync(link)}elseif(stat.isDirectory()){// On Windows, lstatSync().isSymbolicLink() returns false for junctions,// but readlinkSync() still works on them. Try reading as a junction.try{currentTarget=readlinkSync(link)isLink=true}catch{// Not a link — falls through to the error below.}}if(!isLink){thrownewError(`dsh: ${link} exists and is not a symlink; remove it so dsh can manage the installation fallback`)}if(currentTarget===target)returnunlinkSync(link)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
环境 / Environment
复现步骤 / Steps to reproduce
npx @deepseek-ai/dsh web,正常启动错误信息 / Error
根因 / Root Cause
packages/boot/app-boot/src/profile.ts中的ensureSymlink:symlinkSync(target, link, 'junction'),Windows 上实际创建的是 junction 而非 symlinkstat.isSymbolicLink()fs.lstatSync()对 junction 返回isSymbolicLink() === false(junction 与 symlink 是两类不同的 NTFS reparse point),尽管fs.readlinkSync()可以正常读出 junction 的目标结果就是:dsh 自己创建的 junction,下次启动时自己认不出来了。
修复 / Fix
除了
isSymbolicLink(),对目录额外尝试readlinkSync():能读出目标就说明是有效链接(symlink 或 junction 均可)。symlinkSync的EEXIST回退分支也用同样方式判断。完整 diff 见 fork 分支(仓库 PR 已禁用,放在这里供参考):
master...cu-min:fix/windows-junction-symlink
验证 / Testing
All reactions