Skip to content

Chained module resolution during npm install #6424

Closed
@erykwarren

Description

@erykwarren

(related to #2338)

Problem

Install a TS module A, itself depending on another TS module B. npm flattens the dependency structure under node_modules and therefore the resolution algorithm implemented by #2338 is broken when module A is built.

How to repro

  1. clone https://github.com/erykwarren/ts-6424-repro
  2. npm install

The project includes dependency on module ts-lib2, which itself depends on ts-lib1. If you clone ts-lib2 by itself, and run npm install on it, it works. It's only when there's a chained dependency (with npm flattening the modules) that the problem occurs.

Assumptions

Each project is built as an npm postinstall step. I couldn't find out if there is a recommended way to accomplish this differently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions