Expected behavior
npm to correctly install all modules and dependencies based on package.json content
Actual behavior
npm crashes with random errors about missing files or files already existing like:
npm ERR! Linux 4.4.15-moby
npm ERR! argv "/usr/bin/node" "/usr/sbin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm v3.10.5
npm ERR! path /home/app/src/node_modules/browserify/node_modules/.bin
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir
npm ERR! EEXIST: file already exists, mkdir '/home/app/src/node_modules/browserify/node_modules/.bin'
npm ERR! File exists: /home/app/src/node_modules/browserify/node_modules/.bin
npm ERR! Move it away, and try again.
This happens only while invoking in shared folder. If I use ADD
in Dockerfile without mounted volume, it works fine. It also works fine on linux.
I tried latest Docker for Mac stable and latest beta. No difference.
Update: The workaround is to exclude node_modules folder from being shared. I’ve used this method