Resolving "EACCES" or "Missing write access" permission errors when using npm


(Scott Hall) #1

When developers try to run npm install --global @squiz/dxp-cli or they also try to use the CLI to update npm to the latest version they get npm warnings and errors.

Most common output includes Missing write access to /usr/local/lib/node_modules or EACCES error at the top of the command line output.

This is the result of how node/npm has been installed, differences between how it may have been installed historically and then updated recently, along with what installer packages or version managers may be used.

There are a few ways you can try correcting this issue: