Skip to content

DEP0190: shell: true + args 导致 Node 24 弃用警告 #111

@Ljm1023666

Description

@Ljm1023666

环境

  • deepcode-cli: 0.1.24
  • Node.js: v24.15.0
  • OS: Windows 11

问题

启动 deepcode 后出现弃用警告:

(node:14456) [DEP0190] DeprecationWarning: Passing args to a child process
with shell option true can lead to security vulnerabilities, as the arguments
are not escaped, only concatenated.

原因

cli.js 中 MCP 子进程启动代码使用了 child_process.spawn(command, args, { shell: true })。Node 24 开始对此报警。

建议修复

去掉 shell: true,直接使用 args 数组:

spawn(command, args, { ...opts }) // shell 默认 false

而不是:

spawn(command, args, { shell: true, ...opts })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions