npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

`npm install` takes unusally long in docker with overlay

What I Wanted to Do

I ran a pipeline on our CI server (GitLab CI with a dockerized runner). It takes unusually long. The same instructions on another machine work perfectly fine and fast - even in the same image. It seems to me, that this has something to do with the storage driver (overlay) and the way npm handles IO.

I’m not expecting anything actually, but hope that someone could give me a hint in the right direction.

What Happened Instead

It took especially long at these two tasks:

Reproduction Steps

It’s not reproducible outside of our environment (I think), because we are using a private registry for some of our packages and it only happens on 2 machines with overlay as storage driver.

Images used:


npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose' ]
npm info using npm@6.4.1
npm info using node@v10.11.0
npm verb npm-session 71a86f2c0cfc5fd4
npm info lifecycle @stapps/projectmanagement@0.7.0~preinstall: @stapps/projectmanagement@0.7.0
npm timing stage:loadCurrentTree Completed in 9ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 138ms
npm info lifecycle assertion@0.0.1~prepack: assertion@0.0.1
npm info lifecycle assertion@0.0.1~postpack: assertion@0.0.1
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 855130ms
npm timing stage:loadIdealTree Completed in 855334ms
npm timing stage:generateActionsToTake Completed in 45ms
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb makeDirectory /root/.npm/_locks creation not in flight; initializing
npm timing audit compress Completed in 4ms
npm info audit Submitting payload of 15343bytes
npm verb lock using /root/.npm/_locks/staging-ae8c051829544274.lock for /builds/stapps/projectmanagement/node_modules/.staging


npm timing action:extract Completed in 854029ms
npm timing action:finalize Completed in 281ms
npm timing action:refresh-package-json Completed in 494ms


npm timing action:postinstall Completed in 51ms
npm verb unlock done using /root/.npm/_locks/staging-ae8c051829544274.lock for /builds/stapps/projectmanagement/node_modules/.staging
npm timing stage:executeActions Completed in 855867ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm info linkStuff @stapps/projectmanagement@0.7.0
npm info lifecycle @stapps/projectmanagement@0.7.0~install: @stapps/projectmanagement@0.7.0
npm info lifecycle @stapps/projectmanagement@0.7.0~postinstall: @stapps/projectmanagement@0.7.0
npm info lifecycle @stapps/projectmanagement@0.7.0~prepublish: @stapps/projectmanagement@0.7.0
npm info lifecycle @stapps/projectmanagement@0.7.0~prepare: @stapps/projectmanagement@0.7.0
npm timing stage:runTopLevelLifecycles Completed in 1711335ms
npm verb saving []
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
added 226 packages from 569 contributors and audited 573 packages in 1711.545s
found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 1711813ms
npm info ok 

Platform Info

In node:10-alpine:

$ npm --versions
{ npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.12.0',
  openssl: '1.1.0i',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '',
  zlib: '1.2.11' }
$ node -p process.platform