{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/9863","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/9863/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/9863/comments","events_url":"https://api.github.com/repos/npm/npm/issues/9863/events","html_url":"https://github.com/npm/npm/issues/9863","id":110074625,"number":9863,"title":"Reinstalling npm v3 fails on Docker.","user":{"login":"statico","id":137158,"avatar_url":"https://avatars.githubusercontent.com/u/137158?v=3","gravatar_id":"","url":"https://api.github.com/users/statico","html_url":"https://github.com/statico","followers_url":"https://api.github.com/users/statico/followers","following_url":"https://api.github.com/users/statico/following{/other_user}","gists_url":"https://api.github.com/users/statico/gists{/gist_id}","starred_url":"https://api.github.com/users/statico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/statico/subscriptions","organizations_url":"https://api.github.com/users/statico/orgs","repos_url":"https://api.github.com/users/statico/repos","events_url":"https://api.github.com/users/statico/events{/privacy}","received_events_url":"https://api.github.com/users/statico/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/big-bug","name":"big-bug","color":"E03C28"},{"url":"https://api.github.com/repos/npm/npm/labels/bug","name":"bug","color":"A328B3"},{"url":"https://api.github.com/repos/npm/npm/labels/platform-integration","name":"platform-integration","color":"5BA8FF"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/npm/npm/milestones/89","html_url":"https://github.com/npm/npm/milestones/big-bug-backlog","labels_url":"https://api.github.com/repos/npm/npm/milestones/89/labels","id":1841754,"number":89,"title":"big-bug-backlog","description":"","creator":{"login":"iarna","id":983798,"avatar_url":"https://avatars.githubusercontent.com/u/983798?v=3","gravatar_id":"","url":"https://api.github.com/users/iarna","html_url":"https://github.com/iarna","followers_url":"https://api.github.com/users/iarna/followers","following_url":"https://api.github.com/users/iarna/following{/other_user}","gists_url":"https://api.github.com/users/iarna/gists{/gist_id}","starred_url":"https://api.github.com/users/iarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iarna/subscriptions","organizations_url":"https://api.github.com/users/iarna/orgs","repos_url":"https://api.github.com/users/iarna/repos","events_url":"https://api.github.com/users/iarna/events{/privacy}","received_events_url":"https://api.github.com/users/iarna/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":6,"state":"open","created_at":"2016-06-21T22:36:23Z","updated_at":"2016-08-23T23:35:37Z","due_on":null,"closed_at":null},"comments":118,"created_at":"2015-10-06T18:47:39Z","updated_at":"2016-08-26T10:18:49Z","closed_at":null,"body":"Our project initialization scripts make sure a specific version of npm is installed. If npm 3.x is accidentally installed _twice_ the install fails with `EXDEV: cross-device link not permitted`. Installing additional modules results in the same error.\r\n\r\nnpm 2.x does not have this problem.\r\n\r\nUsing Docker 1.8.2, this Dockerfile:\r\n\r\n```dockerfile\r\nFROM ubuntu:14.04\r\n\r\nENV NPM_CONFIG_LOGLEVEL info\r\nENV NODE_VERSION 4.1.1\r\n\r\nRUN apt-get -y install curl\r\n\r\nRUN curl -SLO \"https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz\" \\\r\n  && tar -xzf \"node-v$NODE_VERSION-linux-x64.tar.gz\" -C /usr/local --strip-components=1 \\\r\n  && rm \"node-v$NODE_VERSION-linux-x64.tar.gz\"\r\n\r\nRUN npm install -g npm@3\r\nRUN npm install -g npm@3 # again!\r\nRUN npm install -g coffee-script\r\n\r\nCMD [ \"/bin/bash\" ]\r\n```\r\n\r\nResults in the following:\r\n\r\n```\r\n$ docker build -t npmtest ~/misc/npmtest\r\nSending build context to Docker daemon 2.048 kB\r\nStep 0 : FROM ubuntu:14.04\r\n ---> 91e54dfb1179\r\nStep 1 : ENV NPM_CONFIG_LOGLEVEL info\r\n ---> Using cache\r\n ---> 8794a99ac0a2\r\nStep 2 : ENV NODE_VERSION 4.1.1\r\n ---> Using cache\r\n ---> 3fb65b4c7d55\r\nStep 3 : RUN apt-get -y install curl\r\n ---> Using cache\r\n ---> e1a9f7308089\r\nStep 4 : RUN curl -SLO \"https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz\"   && tar -xzf \"node-v$NODE_VERSION-linux-x64.tar.gz\" -C /usr/local --strip-components=1   && rm \"node-v$NODE_VERSION-linux-x64.tar.gz\"\r\n ---> Using cache\r\n ---> 942c49d39079\r\nStep 5 : RUN npm install -g npm@3\r\n ---> Using cache\r\n ---> 871d339a3944\r\nStep 6 : RUN npm install -g npm@3 # again!\r\n ---> Running in 55fbedab36cf\r\nnpm info it worked if it ends with ok\r\nnpm info using npm@3.3.5\r\nnpm info using node@v4.1.1\r\nnpm info attempt registry request try #1 at 6:46:54 PM\r\nnpm http request GET https://registry.npmjs.org/npm\r\nnpm http 200 https://registry.npmjs.org/npm\r\nnpm info lifecycle npm@3.3.5~preinstall: npm@3.3.5\r\nnpm ERR! Linux 4.0.9-boot2docker\r\nnpm ERR! argv \"/usr/local/bin/node\" \"/usr/local/bin/npm\" \"install\" \"-g\" \"npm@3\"\r\nnpm ERR! node v4.1.1\r\nnpm ERR! npm  v3.3.5\r\nnpm ERR! path /usr/local/lib/node_modules/npm\r\nnpm ERR! code EXDEV\r\nnpm ERR! errno -18\r\nnpm ERR! syscall rename\r\n\r\nnpm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'\r\nnpm ERR!\r\nnpm ERR! If you need help, you may report this error at:\r\nnpm ERR!     <https://github.com/npm/npm/issues>\r\n\r\nnpm ERR! Please include the following file with any support request:\r\nnpm ERR!     /npm-debug.log\r\nThe command '/bin/sh -c npm install -g npm@3 # again!' returned a non-zero code: 238\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/242691767","html_url":"https://github.com/npm/npm/issues/9863#issuecomment-242691767","issue_url":"https://api.github.com/repos/npm/npm/issues/9863","id":242691767,"user":{"login":"davidbarton","id":1619732,"avatar_url":"https://avatars.githubusercontent.com/u/1619732?v=3","gravatar_id":"","url":"https://api.github.com/users/davidbarton","html_url":"https://github.com/davidbarton","followers_url":"https://api.github.com/users/davidbarton/followers","following_url":"https://api.github.com/users/davidbarton/following{/other_user}","gists_url":"https://api.github.com/users/davidbarton/gists{/gist_id}","starred_url":"https://api.github.com/users/davidbarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidbarton/subscriptions","organizations_url":"https://api.github.com/users/davidbarton/orgs","repos_url":"https://api.github.com/users/davidbarton/repos","events_url":"https://api.github.com/users/davidbarton/events{/privacy}","received_events_url":"https://api.github.com/users/davidbarton/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T10:18:49Z","updated_at":"2016-08-26T10:18:49Z","body":"@RichardJECooke this is what I use in my Dockerfile\r\n\r\n```\r\n# Fix bug https://github.com/npm/npm/issues/9863\r\nRUN cd $(npm root -g)/npm \\\r\n  && npm install fs-extra \\\r\n  && sed -i -e s/graceful-fs/fs-extra/ -e s/fs\\.rename/fs.move/ ./lib/utils/rename.js\r\n```"}}
{"actor":{"display_login":"davidbarton"}}