Skip to content

Windows compatibility: npm global commands cannot be spawned without shell workaround #457

Description

@jmadore-payfacto

Summary

zeroshot fails on Windows when trying to spawn itself or the AI provider CLI (e.g. claude) because npm global commands on Windows are .cmd batch files that cannot be directly spawn()-ed by Node.js without shell: true. Additionally, the Jira provider uses a mix of go-jira and ankitpokhrel/jira-cli commands.

Issues Found

1. Jira provider — mixed CLI commands

  • checkAuth() uses jira session (go-jira syntax)
  • fetchIssue() uses jira issue view --template json (ankitpokhrel syntax)

Fixes needed:

  • Change auth check from jira sessionjira me
  • Change --template json--raw (ankitpokhrel's equivalent)

2. spawnTaskProcess in agent-task-executor.jsspawn zeroshot ENOENT

getClaudeTasksPath() returns 'zeroshot' which Node.js cannot find on Windows because the actual executable is zeroshot.cmd.

Fix: On Windows, invoke process.execPath (node.exe) with the CLI script path directly:

if (process.platform === 'win32') {
  const cliScript = path.join(__dirname, '../../cli/index.js');
  spawnCmd = process.execPath;
  spawnArgs = [cliScript, ...args];
}

Same issue exists in claude-task-runner.js.

3. watcher.jsspawn claude ENOENT (no task output)

watcher.js spawns the AI provider command (e.g. claude) which is also a .cmd file. Using shell: true causes arguments containing spaces (e.g. the prompt) to be split into multiple positional args, breaking the CLI invocation.

Fix: Resolve the actual Node.js script path from the .cmd wrapper file and invoke node directly. The .cmd file for any npm global command contains the script path and has a predictable format. Pass commandScript through watcherConfig from runner.js so watcher can use spawn(process.execPath, [commandScript, ...args]) on Windows.

Environment

  • Windows 11
  • Node.js (global npm install)
  • ankitpokhrel/jira-cli for Jira

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions