Skip to content
PidebugCLI & tooling

Fix npm EACCES error installing pi extension globally

Session from pi-sessions on Hugging Face by OmarRabhI · Apache-2.0 · condensed by Coders Talk

4msession
0interventions
GOAL

Fix a permission error when installing the tau-mirror npm package globally via pi, and get global npm installs working without needing sudo.

  1. Prompt · +0
    pi install npm:tau-mirror fails with EACCES permission error
  2. Agent did · +0m
    Investigated /usr/lib/node_modules/tau-mirror, found it already installed and owned by root, explained the permission conflict and offered options (skip, chown, or sudo)
  3. Prompt · +3m
    Could node modules be installed locally inside my home directory instead?
  4. Agent did · +3m
    Checked npm's global prefix (was /usr), created ~/.local/lib/node_modules and ~/.local/bin, set npm prefix to ~/.local, verified ~/.local/bin was already in PATH
  5. Agent did · +3m
    Reinstalled tau-mirror with npm install -g, package landed correctly under ~/.local/lib/node_modules but no binary was found on PATH
  6. Agent did · +3m
    Inspected package.json and determined tau-mirror is a pi extension with no CLI bin, so the missing binary was expected, not a bug
  7. Agent did · +4m
    Re-ran pi install npm:tau-mirror which now succeeded cleanly, installing into the home-directory node_modules path
  8. Outcome · +4m
    npm global prefix switched to ~/.local, tau-mirror installed successfully without sudo, and future global installs will avoid permission errors
VERDICT

Next time I'd just ask upfront to move npm's global prefix to my home directory instead of troubleshooting the EACCES error first — that's what actually fixed things for good. Redirecting the npm prefix to ~/.local was the real fix; the earlier root-owned install was just a symptom.

I tried this · 0

Discussion · 0

How Builds work