I\'m trying to build a docker image with a global install of firebase-tools and angular-cli. I\'m building the same image for two versions of node: 6.x (LTS bor
The problem is because while NPM runs globally installed module scripts as the nobody
user, which kinds of makes sense, recent versions of NPM started setting the file permissions for node modules to root
. As a result module scripts are no longer allowed to create files and directories in their module.
See discussion in NPM issue #3849, for some references.
A simple workaround, which makes sense in a docker environment, is to set the NPM default global user back to root
, like so:
npm -g config set user root
After which you shouldn't have any more EACCES
errors.