`npm ci` skips `bundledDependencies` for local dependency

What I Wanted to Do

I wanted to use npm ci to speed up our build.

We have some special requirements to do with dojo build that mean we need to “wrap” dependenies from npm. We have done this with local packages that define the dependency and mark it as a bundled dependency. Like this

{
  "name": "react",
  "description": "npm wrapper package for react to provide dojo-build capability",
  "dependencies": {
    "react": "^16.8.6"
  },
  "bundledDependencies": [
    "react"
  ],
  "dojoBuild": "package.profile.js"
}

This package is referenced as a dependency in a higher level package.json

When running npm i this restores the bundled deps and then restores the wrapper to the top level node_modules

Expected similar behaviour with npm ci

What Happened Instead

npm ci skips the restoreation of the sub package and the bundled dependencies. Meaning that in this example above react is never downloaded into the wrappers node_modules folder.

Not sure if this is by design for speed or if this is a feature yet to be implemented in npm ci

Reproduction Steps

Details

Platform Info

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

Crazy! I was just about to report this too, but with the npm package itself. apm depends on npm, but using npm ci results in a whole bunch of unmet dependencies :pensive:.

[output snipped to comply with body length regulations]

npm ERR! missing: jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef, required by jasmine-focused@1.0.7
npm ERR! missing: mkdirp@0.3.5, required by jasmine-node@git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef
npm ERR! extraneous: aws-sign2@0.6.0 /Users/winston/github/apm/node_modules/npm/node_modules/aws-sign2
npm ERR! extraneous: camelcase@4.1.0 /Users/winston/github/apm/node_modules/npm/node_modules/camelcase
npm ERR! extraneous: color-convert@1.9.1 /Users/winston/github/apm/node_modules/npm/node_modules/color-convert
npm ERR! extraneous: colors@1.3.0 /Users/winston/github/apm/node_modules/npm/node_modules/colors
npm ERR! extraneous: debug@3.1.0 /Users/winston/github/apm/node_modules/npm/node_modules/debug
npm ERR! extraneous: deep-extend@0.5.1 /Users/winston/github/apm/node_modules/npm/node_modules/deep-extend
npm ERR! extraneous: form-data@2.1.4 /Users/winston/github/apm/node_modules/npm/node_modules/form-data
npm ERR! extraneous: har-validator@4.2.1 /Users/winston/github/apm/node_modules/npm/node_modules/har-validator
npm ERR! extraneous: http-signature@1.1.1 /Users/winston/github/apm/node_modules/npm/node_modules/http-signature
npm ERR! extraneous: iconv-lite@0.4.23 /Users/winston/github/apm/node_modules/npm/node_modules/iconv-lite
npm ERR! extraneous: mime-db@1.33.0 /Users/winston/github/apm/node_modules/npm/node_modules/mime-db
npm ERR! extraneous: ms@2.1.1 /Users/winston/github/apm/node_modules/npm/node_modules/ms
npm ERR! extraneous: npm-run-path@2.0.2 /Users/winston/github/apm/node_modules/npm/node_modules/npm-run-path
npm ERR! extraneous: oauth-sign@0.8.2 /Users/winston/github/apm/node_modules/npm/node_modules/oauth-sign
npm ERR! extraneous: path-exists@3.0.0 /Users/winston/github/apm/node_modules/npm/node_modules/path-exists
npm ERR! extraneous: performance-now@0.2.0 /Users/winston/github/apm/node_modules/npm/node_modules/performance-now
npm ERR! extraneous: pify@3.0.0 /Users/winston/github/apm/node_modules/npm/node_modules/pify
npm ERR! extraneous: pump@3.0.0 /Users/winston/github/apm/node_modules/npm/node_modules/pump
npm ERR! extraneous: qs@6.4.0 /Users/winston/github/apm/node_modules/npm/node_modules/qs
npm ERR! extraneous: supports-color@5.4.0 /Users/winston/github/apm/node_modules/npm/node_modules/supports-color
npm ERR! extraneous: tough-cookie@2.3.4 /Users/winston/github/apm/node_modules/npm/node_modules/tough-cookie
npm ERR! extraneous: wide-align@1.1.2 /Users/winston/github/apm/node_modules/npm/node_modules/wide-align
npm ERR! extraneous: yargs@11.0.0 /Users/winston/github/apm/node_modules/npm/node_modules/yargs
npm ERR! missing: glob@^7.1.2, required by cacache@11.0.2
npm ERR! missing: lru-cache@^4.1.2, required by cacache@11.0.2
npm ERR! missing: ssri@^6.0.0, required by cacache@11.0.2
npm ERR! missing: y18n@^4.0.0, required by cacache@11.0.2
npm ERR! missing: string-width@^2.0.0, required by cli-columns@3.1.2
npm ERR! missing: string-width@^2.1.1, required by cli-table3@0.5.0
npm ERR! missing: glob@^7.1.1, required by init-package-json@1.10.3
npm ERR! missing: lru-cache@^4.1.2, required by npm-registry-fetch@3.1.1
npm ERR! missing: y18n@^4.0.0, required by libnpx@10.2.0
npm ERR! missing: yargs@^11.0.0, required by libnpx@10.2.0
npm ERR! missing: pump@^3.0.0, required by mississippi@3.0.0
npm ERR! missing: readable-stream@^2.2.2, required by concat-stream@1.6.2
npm ERR! missing: readable-stream@^2.0.0, required by duplexify@3.6.0
npm ERR! missing: readable-stream@^2.0.4, required by flush-write-stream@1.0.3
npm ERR! missing: readable-stream@^2.0.0, required by from2@2.3.0
npm ERR! missing: readable-stream@^2.1.5, required by parallel-transform@1.1.0
npm ERR! missing: readable-stream@^2.1.5, required by through2@2.0.3
npm ERR! missing: glob@^7.0.3, required by node-gyp@3.7.0
npm ERR! missing: request@>=2.9.0 <2.82.0, required by node-gyp@3.7.0
npm ERR! missing: lru-cache@^4.1.2, required by make-fetch-happen@4.0.1
npm ERR! missing: ssri@^6.0.0, required by make-fetch-happen@4.0.1
npm ERR! missing: debug@3.1.0, required by http-proxy-agent@2.1.0
npm ERR! missing: debug@^3.1.0, required by https-proxy-agent@2.2.1
npm ERR! missing: glob@^7.1.2, required by pacote@8.1.6
npm ERR! missing: lru-cache@^4.1.3, required by pacote@8.1.6
npm ERR! missing: ssri@^6.0.0, required by pacote@8.1.6
npm ERR! missing: tar@^4.4.3, required by pacote@8.1.6
npm ERR! missing: glob@^7.1.1, required by read-package-json@2.0.13
npm ERR! missing: readable-stream@^2.0.2, required by sha@2.0.1
npm ERR! missing: readable-stream@^2.1.5, required by stream-iterate@1.2.0
npm ERR! missing: camelcase@^4.0.0, required by boxen@1.3.0
npm ERR! missing: string-width@^2.0.0, required by boxen@1.3.0
npm ERR! missing: string-width@^2.0.0, required by ansi-align@2.0.0
npm ERR! missing: npm-run-path@^2.0.0, required by execa@0.7.0
npm ERR! missing: lru-cache@^4.0.1, required by cross-spawn@5.1.0
npm ERR! missing: string-width@^2.1.1, required by widest-line@2.0.0
npm ERR! missing: pify@^3.0.0, required by make-dir@1.3.0

npm 6.9.0, macOS 10.14

1 Like

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