Title: fix: resolve DEP0190 deprecation warning on Windows by dengmik-commits · Pull Request #87 · lessweb/deepcode-cli · GitHub
Open Graph Title: fix: resolve DEP0190 deprecation warning on Windows by dengmik-commits · Pull Request #87 · lessweb/deepcode-cli
X Title: fix: resolve DEP0190 deprecation warning on Windows by dengmik-commits · Pull Request #87 · lessweb/deepcode-cli
Description: 问题 启动 deepcode 时出现 Node.js 废弃警告: (node:119316) [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. 根因 child_process.spawn() 在 shell: true 模式下不应该传入 args 数组——Node.js 只做简单拼接不转义,存在注入风险。v0.1.21 中 PR #77 修复 Windows CI 时引入了此回归:McpClient 和 updateCheck 共 3 处调用都传了 args 数组。 修复 将所有 spawn(cmd, args, { shell: true }) 改为 spawn([cmd, ...args].join(" "), [], { shell: true }),手动拼成字符串后传入。逻辑等价——cmd.exe 仍通过 PATHEXT 解析命令,不会触发 DEP0190,也不会有之前的 .cmd 后缀 bug。 改动文件 文件 改动 src/mcp/mcp-client.ts:141 McpClient.connect() 的 spawn 调用 src/updateCheck.ts:164 runNpmInstallGlobal() — npm 全局安装更新包 src/updateCheck.ts:208 npmViewVersion() — npm view 查询最新版本 updateCheck.ts 的两处在启动时同时触发警告是因为它们先于 MCP 初始化运行:deepcode 启动后立即检查更新和版本信息,这两个 spawn 在 npm 子命令前就触发了 DEP0190。用户看到的启动警告正是来自这里。 验证 npm run typecheck # ✅ 零错误 npm run bundle # ✅ dist/cli.js 启动 deepcode,不再出现 DEP0190 警告。 Closes #85
Open Graph Description: 问题 启动 deepcode 时出现 Node.js 废弃警告: (node:119316) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not es...
X Description: 问题 启动 deepcode 时出现 Node.js 废弃警告: (node:119316) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not es...
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/87
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:aa1696a3-3b4c-6b90-b3bd-12c00c5ac4e3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CB80:1EEE:2322F88:32A1884:6A4FD3D3 |
| html-safe-nonce | 0f985810467d06c5a57febaa6f4061648dc9d20e3d9255795655f3ab144611ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjgwOjFFRUU6MjMyMkY4ODozMkExODg0OjZBNEZEM0QzIiwidmlzaXRvcl9pZCI6IjYxMjAzMTA3MDMzMTgzNTY5NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 52608a4cba90206aac5897f28f8a72b76e2415fc87e60cd42c85a3696b06cae0 |
| hovercard-subject-tag | pull_request:3696193354 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/87/files |
| twitter:image | https://avatars.githubusercontent.com/u/270912164?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/270912164?s=400&v=4 |
| og:image:alt | 问题 启动 deepcode 时出现 Node.js 废弃警告: (node:119316) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not es... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b98c3d9767bb8a56238a89ff8401d1cbdf3bc5c353799aacf49fe6c76b4b7c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 142593e66413bbae27fd485859993597d5a3b104 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width