dsh-node-compat
其他 活跃维护

dsh-node-compat

Robin1987China/dsh-node-compat

轻量级兼容工具,自动识别入口守卫在Node运行时的静默失效,输出清晰诊断信息替代无声退出,无需修改脚本即可保持原有执行逻辑一致。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
13 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Robin1987China/dsh-node-compat
git clone https://github.com/Robin1987China/dsh-node-compat.git
git clone git@github.com:Robin1987China/dsh-node-compat.git
README.md main

dsh-node-compat

Runs DeepSeek Harness on a Node runtime where its entry guard silently
no-ops — and says why, instead of exiting with code 0 and no output.

Symptom search terms: dsh does nothing, dsh web exits immediately, silent
exit code 0, no output no error, import.meta.main undefined, Node 24.1.0,
Node 22.17, npx dsh 启动不成功程序直接退出.

Symptom

dsh, dsh web, or npx @deepseek-ai/dsh web prints nothing, writes
nothing, binds nothing, and exits with code 0.

Root cause

@deepseek-ai/dsh 0.1.5-rc.1 ships lib/bin.js ending in:

if (import.meta.main) await runCli();
export { runCli };

import.meta.main was added in Node 24.2.0 and 22.18.0. On any older
runtime the property is undefined, so runCli() is never called. The module
loads, does nothing, and exits successfully. The package also declares no
engines, so npm never warns.

Verified with real Node binaries:

Node import.meta.main dsh --version
24.1.0 undefined (no output, exit 0)
24.2.0 true 0.1.5-rc.1

What this does

The entry point exports runCli, and runCli() reads
process.argv.slice(2). This launcher imports the same module, calls
runCli() itself, and passes your arguments straight through. On a Node
where the guard works it adds no noise; on one where it does not, it prints
the diagnosis first.

Install

npm install -g dsh-node-compat

Run it in place of dsh:

dsh-compat web
dsh-compat --profile headless "run the tests"

Or alias it:

alias dsh=dsh-compat

To use it without installing anything:

npx dsh-node-compat web

The permanent fix

Upgrade Node to >=24.2.0, or >=22.18.0 on the 22.x line. This package
is a bridge for people who cannot move Node yet, and a diagnosis for people
who do not know why dsh is silent.

The upstream fix is two lines: replace the guard with a check that works on
every supported runtime, and declare engines so npm warns.

Verification

See docs/verification.md for the raw runs. Summary:

Node lib/bin.js --version dsh-compat --version
24.1.0 no output, exit 0 diagnosis + 0.1.5-rc.1
24.2.0 0.1.5-rc.1 0.1.5-rc.1
26.7.0 0.1.5-rc.1 0.1.5-rc.1

Limits

  • This is a workaround, not a fix. Upstream must replace the guard.
  • It resolves @deepseek-ai/dsh/lib/bin.js by file path, because the package
    has no exports map. A future release that adds one and omits that subpath
    would break the resolution; the launcher then reports it instead of going
    silent.
  • It requires @deepseek-ai/dsh to export runCli.

License

MIT