Build fails while installing npm v7


Your team might be already aware of this issue, but since I have this issue for more than 1 week now, and I still can’t found any related open topic about it, npm install -g npm@latest fails with the following error:

npm ERR! syscall rename
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! dest /usr/local/lib/node_modules/.npm-i9nnxROI
npm ERR! errno -18
npm ERR! EXDEV: cross-device link not permitted, rename '/usr/local/lib/node_modules/npm' -> '/usr/local/lib/node_modules/.npm-i9nnxROI'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-30T06_46_38_644Z-debug.log

Exited with code exit status 238
CircleCI received exit code 238

I’m using the node:current Docker image and install the latest npm version before installing/running tests/linters/etc…

1 Like

I’m seeing the same problem. I’ve tried changing the version of npm that’s getting installed, but no luck. Have you found a solution?

Has anyone at CircleCI had a chance to look in to this?

Based on that error, are you by chance running the CircleCI CLI locally? Possibly with the snap version of the CircleCI CLI?

I’m not using the CircleCI CLI. This the head of my config.yml:

version: 2
    working_directory: ~
      - image: node:current
      - checkout
      - run:
          name: npm-update
          command: 'npm install -g npm@latest'

I believe it’s a (recurring) npm issue but I’m a bit suprised that nothing have been said about it here by the CircleCI team or users (except us) since more than 1 month. Also see these both StackOverflow questions:

  • stackoverflow\.com/questions/64504721/why-am-i-getting-a-cross-device-link-not-permitted-error-in-docker-on-gitlab-c
  • stackoverflow\.com/questions/64543012/exdev-cross-device-link-not-permitted-rename-usr-local-lib-node-modules-npm

(As a new user, I’m limited to 2 links per post, therefore I escaped the main domain separator in above urls).

Not using it locally. Just checked and it’s still running in to the same issue. Any chance we’ll get a workaround here or are we left to our own devices?

As noted in the Github issue on the npm repository linked in my previous comment, and as hinted by a recent push to one of my Github repository, successfully passing CircleCI tests, npm fixed this bug in v7.4.2.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.