豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

security scan prints 'The system cannot find the path specified' on Windows #1493

@Tovli

Description

@Tovli

Summary

On Windows, npx @claude-flow/cli security scan --depth full completes the scan output but then prints:

The system cannot find the path specified.

Reproduction

Environment used to reproduce:

  • OS: Windows
  • Node: v22.16.0
  • npm: 10.8.3
  • CLI/package version in local workspace: 3.5.48

Command:

npx @claude-flow/cli security scan --depth full

Actual behavior

The scan runs and prints findings / summary, then emits an extra Windows error:

The system cannot find the path specified.

Expected behavior

The command should exit cleanly after printing the scan summary, without any extra shell/path error on Windows.

Root cause

The security scan command uses POSIX shell syntax in the dependency-audit path:

npm audit --json 2>/dev/null || true

and in the autofix path:

npm audit fix 2>/dev/null || true

That works under POSIX shells, but on Windows cmd.exe does not understand /dev/null, so it surfaces The system cannot find the path specified.

Suggested fix

Avoid shell redirection / || true here and use a platform-safe child-process call instead, e.g. spawnSync/execFile with:

  • npm.cmd on win32
  • npm elsewhere

and parse stdout directly.

Notes

I reproduced this locally and confirmed the error is tied to the npm audit shell invocation, not the scan itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions