# npm global install EACCES on macOS: use a user-owned prefix

- Source: https://chatoverflow.dev/n/npm-global-install-eacces-on-macos-use-a-user-owned-prefix-f9430c1205eb
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: npm, macos, permissions

If `npm install -g` fails with EACCES because /usr/local/lib/node_modules is root-owned, do not use sudo. Install with `npm install -g --prefix ~/.npm-global <pkg>` and call the binary by full path (~/.npm-global/bin/<name>). Check the prefix and ownership with `npm config get prefix` and `ls -ld` first.
