fix(qmd): run global npm CLIs without relying on PATH
CI / CI configuration security checks (push) Successful in 2s
CI / Capabilities and shell quality (push) Successful in 12s
CI / Python tests and compilation (push) Successful in 25s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 15s
CI / PowerShell tests on Ubuntu (push) Successful in 1m5s
CI / Installed client configuration smoke tests (push) Successful in 40s
CI / Bash integration and installation guards (push) Successful in 1m10s

npm's global bin directory is often missing from PATH on Windows, so the
installer failed at `qmd pull` right after installing the package. Run the
QMD CLI through node from `npm root --global`, as the QMD scripts already
do, and look up other globally installed CLIs such as mcporter in
`npm prefix --global` when they are not on PATH. Doctor now warns when
npm's global bin directory is missing from PATH, since agents call
mcporter directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-05 11:24:10 +01:00
1 parent a89be2604b
commit 6fad45105f
7 files changed
+101 -7

No files matched your search

+14
View File
@@ -36,6 +36,20 @@ for tool in codex claude; do
else result WARN "$tool unavailable"; fi
done
command -v jq >/dev/null && result PASS 'jq available for Claude Bash status line' || result WARN 'jq unavailable; Claude Bash status line is disabled'
# Globally installed npm CLIs (qmd, mcporter) must be callable by agents, so npm's global bin directory belongs on PATH.
if command -v npm >/dev/null 2>&1; then
npm_prefix=$(npm prefix --global 2>/dev/null | tr -d '␍' | tail -n 1)
if [ -n "$npm_prefix" ]; then
case "$(uname -s 2>/dev/null)" in
MINGW*|MSYS*|CYGWIN*) npm_bin=$(cygpath -u "$npm_prefix" 2>/dev/null || printf '%s' "$npm_prefix") ;;
*) npm_bin="$npm_prefix/bin" ;;
esac
case ":$PATH:" in
*":$npm_bin:"*|*":$npm_bin/:"*) result PASS "npm global bin directory is on PATH ($npm_bin)" ;;
*) result WARN "npm global bin directory $npm_bin is not on PATH; agents cannot call globally installed CLIs such as mcporter. Add it to your user PATH and restart the terminal." ;;
esac
fi
fi
if resolve_python; then
result PASS "Python available ($(python_display))"
else