DeepSeek harness初体验

DeepSeek Harness初体验

npm i @deepseek-ai/dsh

如果出现下面这个错误

(base) gatilin@gatilindeMacBook-Pro-2 ~ % npm i @deepseek-ai/dsh
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'commander@15.0.0',
npm warn EBADENGINE   required: { node: '>=22.12.0' },
npm warn EBADENGINE   current: { node: 'v20.20.2', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@earendil-works/pi-ai@0.82.1',
npm warn EBADENGINE   required: { node: '>=22.19.0' },
npm warn EBADENGINE   current: { node: 'v20.20.2', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead

added 531 packages in 2m

121 packages are looking for funding
  run `npm fund` for details
(base) gatilin@gatilindeMacBook-Pro-2 ~ % 
(base) gatilin@gatilindeMacBook-Pro-2 ~ % 
(base) gatilin@gatilindeMacBook-Pro-2 ~ % npx dsh web           
file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:1186
		throw new Error(`${binName}: ${stage}: ${detail}${stack}`, { cause });
		      ^

Error: dsh: plugin tree failed to load: failed to apply loader entry include (cordis:include): loader entries failed to apply
AggregateError: loader entries failed to apply
    at EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:91:35)
    at async Include._apply (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:238:3)
    at boot (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:1186:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runProfile (file:///Users/gatilin/node_modules/@deepseek-ai/dsh/lib/profile-boot-DG5t9aNs.js:247:14)
    at async file:///Users/gatilin/node_modules/@deepseek-ai/dsh/lib/bin.js:133:3 {
  [cause]: Error: failed to apply loader entry include (cordis:include): loader entries failed to apply
      at updateError (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:299:9)
      at Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:519:10)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    [cause]: AggregateError: loader entries failed to apply
        at EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:91:35)
        at async Include._apply (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:238:3) {
      [errors]: [
        Error: failed to import loader entry session-persistence-jsonl (@deepseek-ai/dsh-session-persistence-jsonl): The requested module 'node:zlib' does not provide an export named 'createZstdDecompress'
            at updateError (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:299:9)
            at Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:514:10)
            at async Entry.init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:495:4)
            ... 3 lines matching cause stack trace ...
            at async EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:87:21)
            at async Include._apply (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:238:3) {
          [cause]: file:///Users/gatilin/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/index.js:10
          import { constants, createZstdDecompress, zstdCompress, zstdDecompress, zstdDecompressSync } from "node:zlib";
                              ^^^^^^^^^^^^^^^^^^^^
          SyntaxError: The requested module 'node:zlib' does not provide an export named 'createZstdDecompress'
              at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21)
              at async ModuleJob.run (node:internal/modules/esm/module_job:320:5)
              at async ModuleLoader.import (node:internal/modules/esm/loader:606:24)
              at async file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:269:16
              at async Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:512:39)
              at async Entry.init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:495:4)
              at async Entry.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:416:37)
              at async EntryGroup.create (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:55:4)
              at async Promise.allSettled (index 17)
              at async EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:87:21)
        },
        Error: failed to apply loader entry agent-loop (@deepseek-ai/dsh-agent-loop): Promise.withResolvers is not a function
            at updateError (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:299:9)
            at Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:519:10)
            at async Entry.init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:495:4)
            at async Entry.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:416:37)
            at async EntryGroup.create (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:55:4)
            at async Promise.allSettled (index 75)
            at async EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:87:21)
            at async Include._apply (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:238:3) {
          [cause]: TypeError: Promise.withResolvers is not a function
              at <instance_members_initializer> (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js:825:21)
              at new FactoryOwnership (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js:828:13)
              at new AgentLoop (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js:997:20)
              at Fiber.execute (file:///Users/gatilin/node_modules/@deepseek-ai/cordis/lib/index.js:1067:24)
              at file:///Users/gatilin/node_modules/@deepseek-ai/cordis/lib/index.js:1141:34
              at file:///Users/gatilin/.dsh/profiles/web/#agent-loop
              at file:///Users/gatilin/.dsh/profiles/web/#include
        },
        Error: failed to import loader entry code-runtime (@deepseek-ai/dsh-code-runtime-worker-thread): The requested module 'node:module' does not provide an export named 'stripTypeScriptTypes'
            at updateError (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:299:9)
            at Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:514:10)
            at async Entry.init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:495:4)
            ... 3 lines matching cause stack trace ...
            at async EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:87:21)
            at async Include._apply (file:///Users/gatilin/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js:238:3) {
          [cause]: file:///Users/gatilin/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/lib/index.js:1
          import { stripTypeScriptTypes } from "node:module";
                   ^^^^^^^^^^^^^^^^^^^^
          SyntaxError: The requested module 'node:module' does not provide an export named 'stripTypeScriptTypes'
              at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21)
              at async ModuleJob.run (node:internal/modules/esm/module_job:320:5)
              at async ModuleLoader.import (node:internal/modules/esm/loader:606:24)
              at async file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:269:16
              at async Entry._init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:512:39)
              at async Entry.init (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:495:4)
              at async Entry.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:416:37)
              at async EntryGroup.create (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:55:4)
              at async Promise.allSettled (index 78)
              at async EntryGroup.update (file:///Users/gatilin/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js:87:21)
        }
      ]
    }
  }
}

Node.js v20.20.2

这是 Node.js 版本过低导致的。DSH 依赖要求 Node >=22.19.0,你当前是 v20.20.2,因此缺少 Promise.withResolvers、Zstd 和 stripTypeScriptTypes 等 API。

在终端执行:

source ~/.nvm/nvm.sh
nvm install 22.19.0
nvm use 22.19.0
nvm alias default 22.19.0

node -v
cd ~
npx dsh web

确认 node -v 输出为 v22.19.0 或更高后再启动即可。之前的 EBADENGINE 警告正是在提示这个版本不兼容。

npx dsh web
Your user’s .npmrc file (\({HOME}/.npmrc) has a `globalconfig` and/or a `prefix` setting, which are incompatible with nvm. Run `nvm use --delete-prefix v20.20.2 --silent` to unset it. Downloading and installing node v22.19.0... Downloading https://nodejs.org/dist/v22.19.0/node-v22.19.0-darwin-arm64.tar.xz... ########################################################################################################################################################################################################################################## 100.0% Computing checksum with sha256sum Checksums matched! Your user’s .npmrc file (\){HOME}/.npmrc)
has a globalconfig and/or a prefix setting, which are incompatible with nvm.
Run nvm use --delete-prefix v22.19.0 to unset it.
Your user’s .npmrc file (${HOME}/.npmrc)
has a globalconfig and/or a prefix setting, which are incompatible with nvm.
Run nvm use --delete-prefix v22.19.0 to unset it.
default -> 22.19.0 (-> v22.19.0)
v22.19.0
dsh web: http://127.0.0.1:3080

68bc7449-5b49-45a0-b58d-c0de44042d1a

image

posted @ 2026-08-13 23:40  Xu_Lin  阅读(56)  评论(0)    收藏  举报