Skip to content

[macOS] STDIO extensions fail: "chown: command not found" and "env: node: No such file or directory" in Hermit bootstrap #8046

@pilpat

Description

@pilpat

Describe the bug

STDIO-type extensions that use npx mcp-remote fail to initialize on macOS (Apple Silicon) due to two issues in the Hermit bootstrap and Node.js PATH resolution:

  1. chown: command not found (exit 127) — The Hermit install script (install-<sha>.sh) calls chown without a full path. On macOS, chown lives in /usr/sbin/, which is not included in the PATH inherited by GUI-launched apps (Electron). The bootstrap script at ~/.config/goose/mcp-hermit/bin/hermit does not add /usr/sbin to PATH before invoking the install script.

  2. env: node: No such file or directory — Even after Hermit successfully bootstraps and installs Node.js, the npx shim fails because node is not in PATH at runtime. Root causes:

    • The generated hermit.hcl contains a hardcoded env.PATH that overrides Hermit's automatic PATH management, preventing it from adding the Node.js binary directory.
    • Hermit sets NPM_CONFIG_PREFIX to ~/.config/goose/mcp-hermit/.hermit/node/, and adds .hermit/node/bin/ to PATH — but this directory does not contain actual node/npx/npm binaries. The real binaries are in ~/.config/goose/mcp-hermit/cache/pkg/node-<version>/bin/.

Note: The node-setup-common.sh script in Goose.app/Contents/Resources/bin/ only runs hermit install node and does NOT activate the Hermit environment on macOS (activation is Linux-only per the conditional on line ~113). This means npx is invoked via the Hermit shim (bin/npx → symlink to bin/hermit), which relies on hermit exec to set up the environment — but the hardcoded PATH in hermit.hcl breaks this mechanism.


To Reproduce

  1. Install Goose Desktop on macOS (Apple Silicon)
  2. Add a new STDIO extension with command: npx mcp-remote https://block.gitmcp.io/goose/
  3. Save and observe "Failed to add extension" error
  4. Check /tmp/mcp.log for detailed error output

First run shows:

Bootstrapping .../cache/pkg/hermit@stable/hermit from https://github.com/cashapp/hermit/releases/download/stable
/var/folders/.../tmp.XXXXXXXX: line 67: chown: command not found
An error occurred. Exiting with status 127.

After manually fixing the chown PATH issue, subsequent runs show:

Node setup (common) completed successfully.
Executing 'npx' command with arguments: mcp-remote https://block.gitmcp.io/goose/
env: node: No such file or directory
Failed to execute 'npx' with arguments: mcp-remote https://block.gitmcp.io/goose/

Expected behavior

The extension should initialize successfully. Hermit bootstrap should complete without chown errors, and npx should be able to find node in PATH when executing MCP extensions.


Screenshots

(Extension panel showing 6/7 loaded, "Goose Docs" failed with red indicator)


Please provide the following information

  • OS & Arch: macOS 25.3.0 aarch64 (Apple Silicon)
  • Interface: UI
  • Version: 1.28.0
  • Extensions enabled: code_execution, tom, summon, todo, Extension Manager, analyze, goose Docs
  • Provider & Model: openrouter – moonshotai/kimi-k2-thinking

Additional context

Environment details

  • The GUI app's PATH (via launchctl getenv PATH) was: /opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin — missing /usr/sbin and /sbin
  • macOS system /etc/paths correctly includes /usr/sbin and /sbin, but these are not inherited by Electron apps in all configurations

Workarounds applied

Three manual fixes were required to get the extension working:

Fix 1 — Added /usr/sbin and /sbin to PATH in ~/.config/goose/mcp-hermit/bin/hermit:

# After "set -eo pipefail", added:
export PATH="/usr/sbin:/sbin:${PATH}"

Fix 2 — Removed hardcoded PATH override from ~/.config/goose/mcp-hermit/bin/hermit.hcl:

# Changed from:
env = {
  "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
}
# To:
env = {
}

Fix 3 — Created symlinks in ~/.config/goose/mcp-hermit/.hermit/node/bin/ pointing to the actual Node.js binaries in ~/.config/goose/mcp-hermit/cache/pkg/node-<version>/bin/:

ln -sf .../cache/pkg/node-24.14.0/bin/node  .../hermit/node/bin/node
ln -sf .../cache/pkg/node-24.14.0/bin/npm   .../hermit/node/bin/npm
ln -sf .../cache/pkg/node-24.14.0/bin/npx   .../hermit/node/bin/npx
ln -sf .../cache/pkg/node-24.14.0/bin/corepack .../hermit/node/bin/corepack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions