mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-08 11:41:56 +08:00
fix(new-setup): avoid double-bootstrap and corepack EACCES on system Node
Two fixes to the fresh-install path: 1. setup.sh: when `corepack enable` runs as a non-root user against a system-wide Node install (apt-installed to /usr/bin), it fails EACCES trying to symlink /usr/bin/pnpm, leaving pnpm off PATH. Retry with sudo when pnpm is still missing — gated to Linux/WSL so macOS Homebrew prefixes aren't polluted with root-owned shims. 2. SKILL.md step 1: if the probe reports STATUS: unavailable (Node not installed), install Node BEFORE invoking `bash setup.sh`. The old flow ran setup.sh first as a diagnostic, which always failed fast, installed Node, then re-ran — two bootstraps for no reason. Combined: fresh Linux box now goes Node install -> single setup.sh run. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,13 +28,18 @@ If the probe reports `STATUS: unavailable` (Node isn't installed yet), ignore al
|
||||
|
||||
### 1. Node bootstrap
|
||||
|
||||
Always runs — probe can't report on this since it lives below the Node layer.
|
||||
|
||||
> *"Now I'm installing Node and your project's dependencies, so the rest of setup has what it needs to run."*
|
||||
|
||||
Run `bash setup.sh`. Parse the status block.
|
||||
If the probe reported `STATUS: unavailable` (Node isn't installed yet), install Node 22 **before** running `bash setup.sh` — otherwise the first bootstrap run is guaranteed to fail and you'll pay for it twice:
|
||||
|
||||
- `NODE_OK=false` → Offer to install Node 22 (macOS: `brew install node@22`; Linux: `curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs`). Re-run.
|
||||
- macOS: `brew install node@22`
|
||||
- Linux / WSL: `curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs`
|
||||
|
||||
Then run `bash setup.sh`. If the probe reported any other status, run `bash setup.sh` directly — it's idempotent and verifies host deps + native modules.
|
||||
|
||||
Parse the status block:
|
||||
|
||||
- `NODE_OK=false` → Node install didn't take effect (PATH issue, keg-only formula, etc.). Investigate `logs/setup.log`, resolve, re-run.
|
||||
- `DEPS_OK=false` or `NATIVE_OK=false` → Read `logs/setup.log`, fix, re-run.
|
||||
|
||||
> **Loose command:** `bash setup.sh`. Justification: pre-Node bootstrap. Can't call the Node-based dispatcher before Node and `pnpm install` are in place.
|
||||
|
||||
Reference in New Issue
Block a user