Skip to content

Remove hard dependency from @angular/cli onto @angular/compiler-cli to prevent duplicate dependencies and version mismatch #5085

Description

@IgorMinar

OS?

all

Versions.

1.0.0-rc.0

Repro steps.

ng new

The log given by the failure.

no logs, but depending on how npm installs dependencies and in which order users upgrades @angular/compiler and @angular/cli, we can end up with duplicate @angular/tsc-wrapped versions - the one under @angular/cli is usually wrong and should not be used but because of node's module resolution strategy it is preferred over the one that is installed higher up in node_modules by the project.

Ideally we'd make @angular/compiler-cli a peerDependency of @angular/cli but that would mean that we wouldn't be able to install @angular/cli globally without errors or warnings because the global environment will not be providing @angular/compiler-cli.

Because of this, the next best option we have is to remove the dependency declaration from @angular/cli's package.json and instead have cli perform a manual check (via require) to verify that @angular/compiler-cli is provided by the project.

Mention any other details that might be useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions