mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-20 01:11:18 +00:00
fix: use user-local npm prefix for openclaw install (#1941)
npm install -g openclaw fails with EACCES on non-root users (e.g., ubuntu on AWS Lightsail) because /usr/local/lib/node_modules isn't writable. Use the same ~/.npm-global prefix pattern already used by codex and kilocode agents. Fixes both the standard installAgent path and the batched setupOpenclawBatched path (used by Fly). Co-authored-by: spawn-bot <spawn-bot@openrouter.ai> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
357132b506
commit
954f3b4893
2 changed files with 10 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.10.17",
|
||||
"version": "0.10.18",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -327,12 +327,13 @@ export async function setupOpenclawBatched(
|
|||
|
||||
const script = [
|
||||
'echo "==> Checking openclaw..."',
|
||||
'export PATH="$HOME/.bun/bin:$HOME/.local/bin:$PATH"',
|
||||
'export PATH="$HOME/.npm-global/bin:$HOME/.bun/bin:$HOME/.local/bin:$PATH"',
|
||||
"if command -v openclaw >/dev/null 2>&1; then",
|
||||
' echo " openclaw found at $(command -v openclaw)"',
|
||||
"else",
|
||||
' echo " openclaw not found, installing..."',
|
||||
" npm install -g openclaw",
|
||||
" mkdir -p ~/.npm-global/bin && npm config set prefix ~/.npm-global && npm install -g openclaw",
|
||||
' export PATH="$HOME/.npm-global/bin:$PATH"',
|
||||
' command -v openclaw || { echo "ERROR: openclaw install failed"; exit 1; }',
|
||||
"fi",
|
||||
'echo "==> Writing environment variables..."',
|
||||
|
|
@ -475,7 +476,12 @@ export function createAgents(runner: CloudRunner): Record<string, AgentConfig> {
|
|||
cloudInitTier: "full",
|
||||
modelPrompt: true,
|
||||
modelDefault: "openrouter/auto",
|
||||
install: () => installAgent(runner, "openclaw", "source ~/.bashrc && npm install -g openclaw"),
|
||||
install: () =>
|
||||
installAgent(
|
||||
runner,
|
||||
"openclaw",
|
||||
"source ~/.bashrc && mkdir -p ~/.npm-global/bin && npm config set prefix ~/.npm-global && npm install -g openclaw",
|
||||
),
|
||||
envVars: (apiKey) => [
|
||||
`OPENROUTER_API_KEY=${apiKey}`,
|
||||
`ANTHROPIC_API_KEY=${apiKey}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue