Npm install doesn't complete inside docker container

Also seeing the EIO error with npm install with OSX Version 1.12.0-rc4-beta20 (build: 10404). Seems to happen at random. Run “npm install” multiple times and it will eventually finish with no error.

npm ERR! Linux 4.4.15-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code EIO
npm ERR! errno -5
npm ERR! syscall read

npm ERR! EIO: i/o error, read
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

I too am having a similar issue.

npm ERR! Linux 4.4.15-moby
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.10.46
npm ERR! npm  v2.15.1
npm ERR! code EIO
npm ERR! errno 55

npm ERR! EIO, close
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

This occurs when I mount the volume in docker run -v "$PWD":/usr/src/build .... However, if I use a COPY in the Dockerfile and build the image with required files and run it without a volume, it install just fine.

Docker for mac Version 1.12.0-rc4-beta20 (build: 10404)

$ docker info
Client:
 Version:      1.12.0-rc4
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   e4a0dbc
 Built:        Wed Jul 13 03:28:51 2016
 OS/Arch:      darwin/amd64
 Experimental: true

Server:
 Version:      1.12.0-rc4
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   e4a0dbc
 Built:        Wed Jul 13 03:28:51 2016
 OS/Arch:      linux/amd64
 Experimental: true
1 Like

I was happily running ‘npm install’ in a couple of my own containers this morning. When I returned after lunch I had a notification of a new version of docker beta which I downloaded and installed - Version 1.12.0-beta21 (build: 10868). I restarted the same containers that were running this morning quite happily and now I get:

npm WARN enoent ENOENT: no such file or directory, open '/home/****/src/node_modules/eslint/package.json’
npm ERR! Linux 4.4.15-moby
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” "install"
npm ERR! node v4.4.4
npm ERR! npm v3.10.5
npm ERR! path …/esprima/bin/esvalidate.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall symlink

npm ERR! enoent ENOENT: no such file or directory, symlink ‘…/esprima/bin/esvalidate.js’ -> '/home//src/node_modules/lab/node_modules/.bin/esvalidate’
npm ERR! enoent ENOENT: no such file or directory, symlink ‘…/esprima/bin/esvalidate.js’ -> '/home/
/src/node_modules/lab/node_modules/.bin/esvalidate’
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /home/****/src/npm-debug.log
npm ERR! code 1

Since this same container was running quite happily only an hour previously it can only have been introduced by the update. Please help, I can’t do any development!!

PS I’ve tried ‘npm cache clear’ and ‘npm cache clean’ and removing ‘~/.npm’, all to no avail.

Just removed ‘npm install’ command from docker-compose, started container, exec’d into it, deleted node_modules directory and ran ‘npm install’ manually. This time I get:

npm ERR! Linux 4.4.15-moby
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” "install"
npm ERR! node v4.4.4
npm ERR! npm v3.10.5
npm ERR! path /home/redjam/src/node_modules/eslint/node_modules/.bin
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir

npm ERR! EEXIST: file already exists, mkdir '/home/redjam/src/node_modules/eslint/node_modules/.bin’
npm ERR! File exists: /home/redjam/src/node_modules/eslint/node_modules/.bin
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR! /home/redjam/src/npm-debug.log
npm ERR! code 1

redjam@060dbe5f1886:~/src$ ls -la /home/redjam/src/node_modules/eslint/node_modules
ls: cannot access /home/redjam/src/node_modules/eslint/node_modules/.bin: No such file or directory
total 1
drwxr-xr-x 3 redjam redjam 102 Jul 29 17:32 .
drwxr-xr-x 3 redjam redjam 102 Jul 29 17:32 …
d??? ? ? ? ? ? .bin

Huh?? Any idea what this means. I can’t chown or chmod as linux can’t see the directory.

I have the same issue, it started recently when using Docker Version 1.12.0-beta21 (build: 10868).
I’m running OSX El Capitan (10.11.6).

npm ERR! Linux 4.4.15-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--production"
npm ERR! node v5.11.1
npm ERR! npm  v3.8.6
npm ERR! path /app/tmp/node_modules/restify/node_modules/.bin
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall mkdir

npm ERR! EEXIST: file already exists, mkdir '/app/tmp/node_modules/restify/node_modules/.bin'
npm ERR! File exists: /app/tmp/node_modules/restify/node_modules/.bin
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/tmp/npm-debug.log
make: *** [shrinkwrap] Error 239

Here is the diagnostic:

Docker for Mac: version: win-beta-v1.12.0-rc5-beta21-68-g5b59d37
OS X: version 10.11.6 (build: 15G31)
logs: /tmp/FC7335D1-F622-44C2-BA94-FFC64394547B/20160802-114033.tar.gz
[OK]     docker-cli
[OK]     app
[OK]     moby-syslog
[OK]     disk
[OK]     virtualization
[OK]     system
[OK]     menubar
[OK]     osxfs
[OK]     db
[OK]     slirp
[OK]     moby-console
[OK]     logs
[OK]     vmnetd
[OK]     env
[OK]     moby
[OK]     driver.amd64-linux

this bug still exist
Version 1.12.0-beta21 (build: 10868) 5b59d37edb4477448b300c4dd1952952b0e86d09
node:6.3.1

I also had this issue in the last update of the beta and the stable release. Both on OSX. I was getting 404’s sometimes, corrupt files and write failures to the mounted file system.

I got the same issue as @maxwell2022, BUT works on this exact beta version: Version 1.12.0-rc4-beta20 (build: 10404) with node@6.3.1 and npm@3.10.3

Yeah, I’m pretty sure is started with the beta21 for me.

My team is seeing the same problem with beta21 whereas beta20 worked fine. Is there a place where we can download the old version as a temporary solution until this is fixed?

Edit: This has been confirmed by the docker team and fix has already been written but not yet released.

Beta 21.1 has been released which should resolve this issue. Thanks for your patience and your participation in the Docker for Mac Beta!

@dsheets Will this change be made to the stable channel as well? I was having the same issue on the stable channel…

1 Like

@theonlysean my understanding of the current plan is that this bugfix will reach stable early next week in a hotfix in order to ensure the fix does not introduce a worse regression than the defects it corrects. Right now, stable 1.12 and beta are close enough that switching channels either direction shouldn’t cause any issues but they will likely diverge, perhaps incompatibly, later in the 1.13 release cycle and so switching from beta back to stable may not be possible without resetting your installation at that time.

We’re still adjusting to having multiple release channels so we appreciate your thoughts on how we can do this sort of thing better while still exercising caution for stable users.

I was getting this error for hours. I found it very frustrating. I ended up looking through the npm install flags and found one that did the trick --no-bin-links. For whatever reason, npm bin symlinks don’t play nice with docker for mac volumes. If you run:

npm install --no-bin-links

instead of the naked npm install, you should be fine. One more thing: any npm scripts you might have had in your package.json now require that node be referenced manually (e.g. “webpack ...” becomes “node ./node_modules/webpack/bin/webpack ...”).

Hope that helps.

Thanks,

Latest build of beta21 is fixing this for me: Version 1.12.0-beta21 (build: 11019)

In the meantime I was using a Dockerfile to copy the file into the container instead to mount a volume because this issue was link to osxfs.

Hi Sandile,

Are you still experiencing this issue with Version 1.12.0-beta21 (build: 11019)?

Thanks,

David

I’m having that issue on 1.12.0 (stable) build 10871, seems to be 100% reproducible

This issue has been fixed on the beta channel with a Beta 21 hotfix. A stable hotfix should be shipped next week. It is safe to switch bidirectionally between Beta 21 and 1.12 but that guarantee may not hold for other beta releases.

Thanks David, just tested with Beta 21, and like you said it seems to be fixed!

Hi David,

I can also confirm this is fixed in beta 21. Really frustrating issue that is a stumbling block to adopting Docker for Mac full time as I exclusively build node applications. Is there an open Github issue that is tracking this somewhere?

Thanks

Dylan