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.jsby file path, because the package
has noexportsmap. 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/dshto exportrunCli.
License
MIT