Skip to content

[BUG] npm ci fails to install nested local path dependencies #529

@yahgwai

Description

@yahgwai

What / Why

When at least two levels of dependencies are present eg packageA -> packageB -> packageC, and are referenced by local path npm fails to find the reference to packageC and errors with eth following error:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/chris/dev/npmCiLocalPath/packageC/node_modules/packageb/node_modules/packagea/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/chris/dev/npmCiLocalPath/packageC/node_modules/packageb/node_modules/packagea/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

When

For local path dependencies eg file:../packageA which are more than one level deep. Ie a local package references a local package which references a local package.

Where

  • n/a

How

  • n/a

Current Behavior

Fails to install nested dependency.

Steps to Reproduce

Reproducible in the following repo:
https://github.com/yahgwai/npm-ci-local-path

Run the following commands to reproduce:

  1. (cd packageC && npm i) // good - creates a package-lock.json
  2. (cd packageC && npm ci) // error - ENOENT

Expected Behavior

Should not error during npm ci

Who

  • n/a

References

  • n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions