8000 Reinstalling npm v3 fails on Docker. · Issue #9863 · npm/npm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Reinstalling npm v3 fails on Docker. #9863

Open
statico opened this issue Oct 6, 2015 · 150 comments · Fixed by jenkinsci/blueocean-plugin#1509
Open

Reinstalling npm v3 fails on Docker. #9863

statico opened this issue Oct 6, 2015 · 150 comments · Fixed by jenkinsci/blueocean-plugin#1509

Comments

@statico
Copy link
statico commented Oct 6, 2015

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:

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_VERSION 4.1.1
 ---> Using cache
 ---> 3fb65b4c7d55
Step 3 : RUN apt-get -y install curl
 ---> Using cache
 ---> e1a9f7308089
Step 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"
 ---> Using cache
 ---> 942c49d39079
Step 5 : RUN npm install -g npm@3
 ---> Using cache
 ---> 871d339a3944
Step 6 : RUN npm install -g npm@3 # again!
 ---> Running in 55fbedab36cf
npm info it worked if it ends with ok
npm info using npm@3.3.5
npm info using node@v4.1.1
npm info attempt registry request try #1 at 6:46:54 PM
npm http request GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm info lifecycle npm@3.3.5~preinstall: npm@3.3.5
npm ERR! Linux 4.0.9-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@3"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.5
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log
The command '/bin/sh -c npm install -g npm@3 # again!' returned a non-zero code: 238
@whummer
Copy link
whummer commented Oct 11, 2015

+1, when trying to install gulp twice:

npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--ignore-scripts" "-g" "gulp@^3.9.0"
npm ERR! node v0.12.7
npm ERR! npm  v3.3.6
npm ERR! path /usr/local/lib/node_modules/gulp
npm ERR! code EXDEV
npm ERR! errno -18

npm ERR! EXDEV, rename '/usr/local/lib/node_modules/gulp'
npm ERR! 

@SteveMarshall
Copy link

This appears to be because aufs (Docker's default filesystem) will often cause rename(2) to return EXDEV, regardless of apparent aufs device boundaries. From the aufs manual:

To rename(2) directory may return EXDEV even if both of src and tgt are on the same aufs. When the rename-src dir exists on multiple branches and the lower dir has child(ren), aufs has to copyup all his children. It can be recursive copyup. Current aufs does not support such huge copyup operation at one time in kernel space, instead produces a warning and returns EXDEV. Generally, mv(1) detects this error and tries mkdir(2) and rename(2) or copy/unlink recursively. So the result is harmless. If your application which issues rename(2) for a directory does not support EXDEV, it will not work on aufs. Also this specification is applied to the case when the src directroy exists on the lower readonly branch and it has child(ren).

The actual error in npm appears to be during finalize for a new version of an already-installed module, when moving the old version to a .DELETE folder.

Based on the comment above from the aufs documentation, that would suggest that calls to fs.rename should probably be slightly more carefully handled, possibly warranting wrapping in graceful-fs?

@othiym23
Copy link
Contributor

graceful-fs is already used consistently throughout npm, but since it's mostly intended to deal only with EMFILE issues, it isn't going to help here. I'm pretty sure that npm's behavior here is, in general, what we want it to be doing to satisfy the goal of more robust, transactional installs, but I wouldn't object to a patch that worked more consistently with the grain of aufs and Docker in general.

@qrpike
Copy link
qrpike commented Oct 30, 2015

This happens to me when running npm update. Since docker caches my NPM install, I only run npm update to check for newer packages, not re-installing everything.

It's very frustrating. NPM3 is so much better, but it's killing my docker images because of this 1 small issue.

Any way we can get a fix for this?

@iarna
Copy link
Contributor
iarna commented Oct 30, 2015

< 8000 a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/qrpike/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/qrpike">@qrpike The fastest way to get a fix for this would be to write a module that implements an fs.rename that, if it gets EXDEV falls back to making the new directory and recursively calling itself on all of the contents of the original dir and rmdiring the original before returning. If an extensively tested module like I've described existed, the patch to npm would be straightforward and I'd be happy to prioritize its use.

My biggest concern (and one I haven't investigated yet) is that ordinarily rename is an atomic operation, in fact, it's one of the only atomic operations one has available when dealing with the filesystem. If the code calling it is expecting it to be atomic, we wouldn't be able to use a module as I've described.

@mhart
Copy link
Contributor
mhart commented Oct 30, 2015

Oh ouch, just ran into this too – it's completely preventing npm3 from being updated on docker images.

Reproduce:

docker run mhart/alpine-node:5 npm install -g npm
# OR
docker run mhart/alpine-node:5 npm update -g npm

@jsmith-dev
Copy link

+1

npm ERR! Linux 4.0.5
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "npm"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /pipeline/source/npm-debug.log

@amir-rahnama
Copy link

+1

Step 7 : RUN npm install http-server
 ---> Running in 47faed65875d
npm info it worked if it ends with ok
npm info using npm@3.3.6
npm info using node@v5.0.0
npm info attempt registry request try #1 at 8:48:06 AM
npm http request GET https://registry.npmjs.org/http-server
npm http 304 https://registry.npmjs.org/http-server
npm info attempt registry request try #1 at 8:48:06 AM
npm http request GET https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/colors
npm info lifecycle http-server@0.8.5~preinstall: http-server@0.8.5
npm ERR! Linux 4.1.10-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "http-server"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! path /app/node_modules/http-server
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/app/node_modules/http-server' -> '/app/node_modules/.http-server.DELETE'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log```

@dieend
Copy link
dieend commented Nov 10, 2015

Having this same problem. Any workaround?

@0x6a68
Copy link
0x6a68 commented Nov 10, 2015

use docker image node:4 which uses npm 2.14.7

@haggholm
Copy link

@iarna node-fs-extra contains a move() operation which attempts rename() and uses other mechanisms on errors like EXDEV.

My biggest concern (and one I haven't investigated yet) is that ordinarily rename is an atomic operation, in fact, it's one of the only atomic operations one has available when dealing with the filesystem. If the code calling it is expecting it to be atomic, we wouldn't be able to use a module as I've described.

Knowing that this issue is a major stumbling block for Docker containers in particular, could you consider a conditional based on e.g. checking if npm is running in a container, or an environment variable like I_ACCEPT_THE_RISK_OF_NONATOMIC_MOVES? —using fs.rename() by default, but fs-extra’s move() if enabled. (Of course, I say this hoping that an opt-in behaviour, being less disruptive, could make it in sooner….)

@haggholm
Copy link

Added trivial PR to go with previous comment. I don’t know if that’s the sort of thing you accept for npm, so feel 100% free to toss it with no risk of thereby offending me… Unfortunately I can’t test it properly as my Docker environment is also suffering from #10372 (not really related except for breaking in the same Docker setup).

@armandabric
Copy link

My CI is also blocked by this issue.

adalinesimonian added a commit to adalinesimonian/docker-anvil-connect that referenced this issue Nov 19, 2015
Updating packages is currently broken on npm 3 running on AUFS

Upstream issue: npm/npm#9863
@trygve-lie
Copy link
8000

Did run into the same issue on a plain npm install. Node 5.1.0 and the bundled npm version.

Switching the Docker image from aufs to overlayfs seems to work.

@jakutis
Copy link
jakutis commented Nov 25, 2015

Happens to me also on docker image (Dockerfile FROM node:5.1.0) build:

npm ERR! EXDEV: cross-device link not permitted, rename '/app/node_modules/sails-permissions/node_modules/lodash' -> '/app/node_modules/sails-permissions/node_modules/sails-generate-entities/node_modules/lodash'

Although FROM node:5.0.0 works perfectly..

@johandry
Copy link

I use a workaround to upgrade npm that is not failing. Instead of 'npm install -g npm' I use:

curl -L https://npmjs.org/install.sh | sh

My Dockerfile have:

RUN     yum install -y epel-release
RUN     yum install -y nodejs npm

# Upgrade node and npm to latest version
RUN     npm cache clean
RUN     npm install -g n
RUN     n stable
RUN     curl -L https://npmjs.org/install.sh | sh

The result is:

[root@a7923d2645b4 ~]# node -v
v5.0.0
[root@a7923d2645b4 ~]# npm -v
3.5.0

@cookandy
Copy link
cookandy commented Dec 2, 2015

Same issue when trying to downgrade npm from a newer version of node:

npm ERR! Linux 4.1.10-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@2.14.13"
npm ERR! node v5.1.0
npm ERR! npm  v3.3.12
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'

Dockerfile:

FROM node:5.1.0

ENV NPM_VERSION 2.14.13

RUN  npm install -g npm@"$N
8000
PM_VERSION"  \
      && npm cache clear

CMD [ "node" ]

nodejs/docker-node#70

@iilei
Copy link
iilei commented Dec 5, 2015

same issue with node:5.1.0

@parkr
Copy link
parkr commented Dec 8, 2015

Also having this problem with Node 5.0.0 and NPM 3.3.6.

@TomTomaso
Copy link

same problem here:
pm ERR! Linux 4.1.13-boot2docker
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "npm@3.3.6"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename

npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
The command '/bin/sh -c npm install -g npm@"$NPM_VERSION"' returned a non-zero code: 238

@dciccale
Copy link

Same issue:

npm     ERR!   Linux 3.13.0-40-generic
npm     ERR!     argv   "/usr/local/bin/node" "/usr/local/bin/npm" "update" "-g" "npm"
npm     ERR!     node   v5.2.0
npm     ERR!     npm    v3.3.12
npm     ERR!     path   /usr/local/lib/node_modules/npm
npm     ERR!     code   EXDEV
npm     ERR!     errno   -18
npm     ERR!     syscall   rename

npm     ERR!   EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm.DELETE'
npm     ERR!   
npm     ERR!   If you need help, you may report this error at:
npm     ERR!       <https://github.com/npm/npm/issues>

npm     ERR!   Please include the following file with any support request:
npm     ERR!       /home/app/npm-debug.log

@evieluvsrainbows
Copy link

Have you guys tried updating your guys' npm versions to 3.5.2?

@evieluvsrainbows
Copy link

@dciccale Also, why are you using such an old kernel?

@dciccale
Copy link

@KamranMackey That is the log output from dockerhub

@frank-dspeed
Copy link

Simply replace the rename method with something cross device compatible the way to go is fork this of and implament https://www.npmjs.com/package/fs.extra as replacement for fs methods then use move not fs.rename

@melv-n
Copy link
melv-n commented Feb 28, 2017

Node v6.9.1 and still having this issue

@frank-dspeed
Copy link
frank-dspeed commented Feb 28, 2017

@mirague even with node 8 you get that error and also node 9 :) its a NPM design Problem not a NodeJS issue :)

NPM === not 100% compatible to all Docker Storage Engines :)

@iarna
Copy link
Contributor
iarna commented Mar 1, 2017

Speaking of the devil… we have a new PR. =D

@mhart
Copy link
Contributor
mhart commented Mar 1, 2017

Niiiiiiice 👍

@frank-dspeed
Copy link

@iarna hahah ya but good that we all have since years a patched method that works great and simply use fs.move in the cases where its needed ;)

@jeff1evesque
Copy link
jeff1evesque commented Mar 8, 2017

I thought I had installed npm version 4.x. But, my docker container says 3.x was installed, and gave me the following travis ci traceback full of errors:

Error: Execution of '/usr/bin/npm install --global uglify-js@2.7.5' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "uglify-js@2.7.5"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/uglify-js
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/uglify-js' -> '/usr/lib/node_modules/.uglify-js.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[uglify-js@2.7.5]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global uglify-js@2.7.5' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "uglify-js@2.7.5"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/uglify-js
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/uglify-js' -> '/usr/lib/node_modules/.uglify-js.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: Execution of '/usr/bin/npm install --global imagemin@5.2.2' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "imagemin@5.2.2"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/imagemin
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/imagemin' -> '/usr/lib/node_modules/.imagemin.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[imagemin@5.2.2]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global imagemin@5.2.2' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "imagemin@5.2.2"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/imagemin
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/imagemin' -> '/usr/lib/node_modules/.imagemin.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: Execution of '/usr/bin/npm install --global node-sass@4.5.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "node-sass@4.5.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/node-sass
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/node-sass' -> '/usr/lib/node_modules/.node-sass.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[node-sass@4.5.0]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global node-sass@4.5.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "node-sass@4.5.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/node-sass
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/node-sass' -> '/usr/lib/node_modules/.node-sass.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: Execution of '/usr/bin/npm install --global babel-core@6.22.1' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "babel-core@6.22.1"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/babel-core
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/babel-core' -> '/usr/lib/node_modules/.babel-core.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[babel-core@6.22.1]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global babel-core@6.22.1' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "babel-core@6.22.1"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/babel-core
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/babel-core' -> '/usr/lib/node_modules/.babel-core.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: Execution of '/usr/bin/npm install --global browserify@14.0.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "browserify@14.0.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/browserify
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/browserify' -> '/usr/lib/node_modules/.browserify.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[browserify@14.0.0]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global browserify@14.0.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "browserify@14.0.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/browserify
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/browserify' -> '/usr/lib/node_modules/.browserify.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: Execution of '/usr/bin/npm install --global babelify@7.3.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "babelify@7.3.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/babelify
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/babelify' -> '/usr/lib/node_modules/.babelify.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Error: /Stage[main]/Package::Webcompilers/Package[babelify@7.3.0]/ensure: change from absent to present failed: Execution of '/usr/bin/npm install --global babelify@7.3.0' returned 238: npm ERR! Linux 4.4.0-51-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--global" "babelify@7.3.0"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! path /usr/lib/node_modules/babelify
npm ERR! code EXDEV
npm ERR! errno -18
npm ERR! syscall rename
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/lib/node_modules/babelify' -> '/usr/lib/node_modules/.babelify.DELETE'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

@MatthiasKuehneEllerhold
Copy link
MatthiasKuehneEllerhold commented Jul 7, 2017

Seems like the fix is no longer necessary (and actively fails):

Step 5/7 : RUN cd $(npm root -g)/npm     && npm install -g fs-extra     && sed -i -e s/graceful-fs/fs-extra/ -e s/fs.rename/fs.move/ ./lib/utils/rename.js     && npm install -g npm
 ---> Running in 705a8d63d3f8
+ fs-extra@3.0.1
added 4 packages in 0.719s
sed: can't read ./lib/utils/rename.js: No such file or directory

https://deb.nodesource.com/setup_8.x
npm: 5.1.0

@alistairjcbrown
Copy link

Can confirm that using npm 5.0.3 on our docker image (coming from the latest node 8.1.3), there were no problems upgrading npm to 5.1.0 using npm install -g npm@5.1.0
Previously we'd curled the install.sh script to install new npm versions - but that didn't seem to be working, so gave npm install a try and it worked.

@frank-dspeed
Copy link

@MatthiasKuehneEllerhold thats logical as you see npm 5 don't has that file that this fix patches do you need a new fix for it then open please a issue like npm 5 exdev problem on docker then you post a link here and i will address that with a new patch

@MatthiasKuehneEllerhold
Copy link
MatthiasKuehneEllerhold commented Jul 7, 2017

A short test confirms that everything works as expected without the fix. So for now I'm good. Thanks!
EDIT: one issue occured though: #15558
Fortunatly there is a fix in the linked issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0