Skip to content

Dependency hoisting issues with @angular-devkit/build-angular 0.803.14 #2012

@the-ult

Description

@the-ult

Expected Behavior

NX is using the @angular-devkit/build-angular provided by Angular instead of multiple versions

Current Behavior

After upgrading to NX 8.7.0 running a project does not work anymore (building works without problems)

  • npm run start simple-app fails. (as does ng serve simple-app)

@nrwl/linter seems to have a direct dependency on an older version of @angular-devkit/build-angular and @nrwl/node also a direct dependency on webpack-dev-server. Essentially you are ending up with 3 versions of webpack-dev-server and @angular-devkit/build-webpack is picking up the buggy version.

Detailed information

I started the issue in Angular CLI, but it seems the root cause is caused by NX.

For detailed information and a sample repo @see

npm ls webpack-dev-server
ult-starter-workspace@0.0.0 
+-- @angular-devkit/build-angular@0.803.15
| `-- webpack-dev-server@3.9.0
`-- @nrwl/node@8.7.0
  +-- @nrwl/linter@8.7.0
  | `-- @angular-devkit/build-angular@0.803.2
  |   `-- webpack-dev-server@3.8.0
  `-- webpack-dev-server@3.1.14
❯ npm ls webpack
ult-starter-workspace@0.0.0 /home/the_ult/dev/ult-starter-workspace
├─┬ @angular-devkit/build-angular@0.900.0-next.18
│ └── webpack@4.41.2 
└─┬ @nrwl/node@8.7.0
  ├─┬ @nrwl/linter@8.7.0
  │ └─┬ UNMET PEER DEPENDENCY @angular-devkit/build-angular@0.803.2
  │   └── webpack@4.39.2  deduped
  └── webpack@4.39.2 

npm ERR! peer dep missing: @angular-devkit/build-angular@>=0.800.0, 
required by @angular-eslint/builder@0.0.1-alpha.17

Context

>  NX  Report

  @nrwl/angular : 8.7.0
  @nrwl/cli : 8.7.0
  @nrwl/cypress : 8.7.0
  @nrwl/eslint-plugin-nx : 8.7.0
  @nrwl/express : 8.7.0
  @nrwl/jest : 8.7.0
  @nrwl/linter : 8.7.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 8.7.0
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 8.7.0
  @nrwl/web : Not Found
  @nrwl/workspace : 8.7.0
  typescript : 3.6.4
ng --version

Angular CLI: 9.0.0-next.18
Node: 12.9.1
OS: linux x64
Angular: 9.0.0-next.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.3
@angular-devkit/build-angular     0.900.0-next.18
@angular-devkit/build-optimizer   0.900.0-next.18
@angular-devkit/build-webpack     0.900.0-next.18
@angular-devkit/core              9.0.0-next.18
@angular-devkit/schematics        8.3.3
@angular/cdk                      8.2.3
@angular/cli                      9.0.0-next.18
@angular/material                 8.2.3
@ngtools/webpack                  9.0.0-next.18
@schematics/angular               8.3.3
@schematics/update                0.900.0-next.18
rxjs                              6.5.3
typescript                        3.6.4
webpack                           4.39.2

Other

There a 2 different issues, but since the root cause seems to be the same, I referenced them both in this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions