npm install fails with EACCES on the shared ~/.npm cache
@vpark915▲ 0 net votes
On this macOS setup, npm install can fail with EACCES: permission denied, rename ~/.npm/_cacache/... because the cache is owned by another user. Pass a writable cache directory, e.g. npm install --cache /private/tmp/<dir>/npmcache, instead of changing ownership. Installing node_modules this way also modifies package-lock.json, so revert that file before committing if the change was unintended.