Reinstalling npm v3 fails on Docker.
### Update 2016-09-06 with temporary fix Fix from @davidbarton ``` # Fix bug https://github.com/npm/npm/issues/9863 RUN cd $(npm root -g)/npm \ && npm install fs-extra \ && sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js ``` Alternate fix from @nordluf ``` RUN npm install --production RUN mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm install ``` ### Background 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. npm 2.x does not have this problem. Using Docker 1.8.2, this Dockerfile: ``` dockerfile FROM ubuntu:14.04 ENV NPM_CONFIG_LOGLEVEL info ENV NODE_VERSION 4.1.1 RUN apt-get -y install curl 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" RUN npm install -g npm@3 RUN npm install -g npm@3 # again! RUN npm install -g coffee-script CMD [ "/bin/bash" ] ``` Results in the following: ``` $ docker build -t npmtest ~/misc/npmtest Sending build context to Docker daemon 2.048 kB Step 0 : FROM ubuntu:14.04 ---> 91e54dfb1179 Step 1 : ENV NPM_CONFIG_LOGLEVEL info ---> Using cache ---> 8794a99ac0a2 Step 2 : ENV NODE_VE
Posted by statico on Oct 6, 2015, 6:47 PM
Tags
Related issues
- CC v2.1.100+ inflates cache_creation by ~20K tokens vs v2.1.98 — same payload, server-side
- Max Plan: Token usage increased ~3-5x without any configuration change (since ~March 28-29)
- I use 43" Dell Ultrasharp, it comes with built-in kvm for switching between signal sources so I can connect both my macbook and linux lap...
- Feature Request: Official Headless Mode & Enhanced CLI for Steam Client
- Linux workspace rendering issues
- Git - create git graph visualization
Raise real-world problems, find people facing the same issue, and discuss solutions.5,000 issues0 comments
onboarding (Sysadmin)
CC v2.1.100+ inflates cache_creation by ~20K tokens vs v2.1.98 — same payload, server-side
Max Plan: Token usage increased ~3-5x without any configuration change (since ~March 28-29)
I use 43" Dell Ultrasharp, it comes with built-in kvm for switching between signal sources so I can connect both my macbook and linux lap...
Feature Request: Official Headless Mode & Enhanced CLI for Steam Client
Linux workspace rendering issues
Git - create git graph visualization
High memory usage from VMMEM with docker desktop windows x64 V4.12.0
Cannot apply CRD and a CR using it in the same plan/apply due to SSA
Reinstalling npm v3 fails on Docker.
### Update 2016-09-06 with temporary fix Fix from @davidbarton ``` # Fix bug https://github.com/npm/npm/issues/9863 RUN cd $(npm root -g)/npm \ && npm install fs-extra \ && sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js ``` Alternate fix from @nordluf ``` RUN npm install --production RUN mv ./node_modules ./node_modules.tmp && mv ./node_modules.tmp ./node_modules && npm install ``` ### Background 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. npm 2.x does not have this problem. Using Docker 1.8.2, this Dockerfile: ``` dockerfile FROM ubuntu:14.04 ENV NPM_CONFIG_LOGLEVEL info ENV NODE_VERSION 4.1.1 RUN apt-get -y install curl 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" RUN npm install -g npm@3 RUN npm install -g npm@3 # again! RUN npm install -g coffee-script CMD [ "/bin/bash" ] ``` Results in the following: ``` $ docker build -t npmtest ~/misc/npmtest Sending build context to Docker daemon 2.048 kB Step 0 : FROM ubuntu:14.04 ---> 91e54dfb1179 Step 1 : ENV NPM_CONFIG_LOGLEVEL info ---> Using cache ---> 8794a99ac0a2 Step 2 : ENV NODE_VE
Comments (0)
No comments yet. Start the discussion.