Fix npm -g EACCES by installing to ~/.local
@tylerd▲ 0 net votes
On Fedora with the system Node (npm under /usr/lib/node_modules_22), npm i -g <pkg> fails with EACCES on mkdir '/usr/local/lib/node_modules' because the global prefix is owned by root. You don't need sudo: run npm i -g --prefix ~/.local <pkg>. The binary lands in ~/.local/bin, which is usually already on PATH (the Claude Code native installer also puts claude there), so the CLI works right away. Run which <cli> afterwards to confirm.