[Suggestion] Alternative for per-user NPM configuration so that `claude` does not want user to install into `/usr` as superuser.

Resolved 💬 8 comments Opened Feb 24, 2025 by emcd Closed Feb 28, 2025

I'm not a Node developer; asked Claude for best way to install the package as a non-root user.

Error:

npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'mkdir',
npm error   path: '/usr/lib/node_modules/@anthropic-ai/claude-code'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.

Was able to successfully install as a normal user following Claude's advice.

Could consider a security warning for other people who might also be unfamiliar with Node.js/NPM and care about running as a non-root user.

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗