6.8.0: `npm ci` fails with local dependency

(John Firebaugh) #1

What I Wanted to Do

Run npm ci in a module with a local dependency on a parent directory.

What Happened Instead

npm ci failed with the following message:

npm ERR! left-pad not accessible from scratch

Reproduction Steps

I have created a test repository that demonstrates the issue:

Clone this and run test.sh.

Details

I suspect this is fallout from https://github.com/npm/cli/pull/86. I had been eagerly awaiting this fix for local dependencies, but it seems they are still buggy.

2019-02-15T01_08_54_287Z-debug.log (1.6 KB)

Platform Info

$ npm --versions
{ scratch: '1.0.0',
  npm: '6.8.0',
  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.14.1',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.36',
  zlib: '1.2.11' }
$ node -p process.platform
darwin
npm ci fail to local packages
(Lars Willighagen) #2

That looks like a problem in submodule/package-lock.json, I’d expect an additional dependencies object under the scratch dep there.

(Joel Marcotte) #3

I’m replying here although this issue is closely related to npm ci fail to local packages.

It looks like the problem of missing dependencies was introduced here: https://github.com/npm/cli/commit/d5137091dd695a2980f7ade85fdc56b2421ff677

Now, without them, the npm-logical-tree package can’t resolve some of the dependencies for this local package, but the question is whether it should or not? I don’t know much about how npm ci works but is the expectation that npm CI should also installs the submodule in their respective folder? These children dependencies have package-lock.json as well, so would these be respected?

(Collin Sauve) #4

Looks like this has been broken for at least a few months now. Any effort to fix this? Anyone know a work-around? I just had to manually edit the child project’s package-lock.json.

1 Like