#7938: fix(agents): install node skills with --prefix CONFIG_DIR for non-root/Docker
agents
stale
Cluster:
Plugin Management Enhancements
## Problem
When using the dashboard **Install** button for node-based skills (e.g. ClawHub), the install runs `npm install -g` (or pnpm/yarn/bun global). In Docker and other non-root environments this fails with **EACCES** because the process cannot write to `/usr/local/lib/node_modules`.
## Solution
Use `npm install --prefix CONFIG_DIR` (and `pnpm add --prefix CONFIG_DIR`) so packages are installed into the OpenClaw config directory, which is writable by the running user. For yarn/bun we use `npm install --prefix CONFIG_DIR` since they don't support a prefix for `add`/global install.
## Result
- Dashboard Install works in Docker (e.g. Coolify) and when running as non-root.
- Installed packages live under `CONFIG_DIR/node_modules` and persist with the rest of config.
- No behavior change for users who already run as root (installs just go to config dir instead of global).
Made with [Cursor](https://cursor.com)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR changes how node-based skill installs are executed in `src/agents/skills-install.ts`, replacing global installs (e.g. `npm install -g`, `pnpm add -g`, `yarn global add`, `bun add -g`) with prefix-based installs targeting `CONFIG_DIR` to avoid EACCES failures in Docker/non-root environments.
The approach fits the existing skills installer architecture by only adjusting the command construction for `SkillInstallSpec.kind === "node"`, leaving other installer kinds (brew/go/uv/download) unchanged and continuing to use `runCommandWithTimeout` for execution.
Main concern: prefix installs don’t automatically expose installed CLIs on PATH, so node skill installs may still not satisfy `hasBinary(...)`/`bins` expectations unless the runtime PATH is updated to include `CONFIG_DIR/node_modules/.bin` (or another strategy is used to surface executables).
<h3>Confidence Score: 3/5</h3>
- This PR is likely safe to merge but may not fully achieve the intended “install makes tool available” behavior for node-based skills.
- The change is small and scoped, but switching from global installs to prefix installs alters the semantics: packages will install into `CONFIG_DIR/node_modules` without necessarily exposing their binaries on PATH, which can cause node skill installs to still appear missing or be unusable unless PATH handling is addressed elsewhere.
- src/agents/skills-install.ts (node installer command construction and how installed binaries are expected to be discovered/used)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
81.2%
#6631: fix: configure npm global prefix for non-root user in Docker
by tjetzinger · 2026-02-01
80.2%
#23079: fix(skills): fallback to npm for summarize skill on non-darwin systems
by charojo · 2026-02-22
80.2%
#8873: fix: document skill loading locations in system prompt
by ytfh44 · 2026-02-04
77.5%
#9227: Fix: Windows Web UI shows 'brew not installed' for all skills
by vishaltandale00 · 2026-02-05
76.4%
#6064: fix(daemon): prefer bundled node from install-cli.sh over system node
by joyshmitz · 2026-02-01
76.2%
#9215: Fix: Inject skill env vars into subagent exec commands
by vishaltandale00 · 2026-02-05
75.0%
#22467: fix: failure while installing skills
by vivganes · 2026-02-21
74.9%
#16295: fix: filter brew install options when brew is unavailable
by superlowburn · 2026-02-14
74.7%
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
74.2%