Nx: [@nrwl/angular] Fresh install fails to build

Created on 13 Mar 2020  路  1Comment  路  Source: nrwl/nx

Expected Behavior

nx build should build a fresh/clean project.

Current Behavior

nx build throw this error

Cannot find module '@angular/compiler'

Failure Information (for bugs)

Steps to Reproduce

Run these commands in order

  1. yarn create nx-workspace
  2. yarn add --dev @nrwl/angular
  3. nx g @nrwl/angular:lib ng-lib --publishable
  4. nx build

Observe error

Cannot find module '@angular/compiler'

Context

Here's a repo with the generated code https://github.com/snebjorn/nx-test
Every command run have its own commit so it's easy to see the diff

>  NX  Report complete - copy this into the issue template

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

Failure Logs

The shell output (slightly cleaned up)
https://gist.github.com/snebjorn/a9e7119ea04e75f37231a4b12807dabd

Other

Besides the build error a bunch of warnings were shown during the setup. I think it would be best to get that sorted out.

Examples: (see the shell output for context)

warning "create-nx-workspace > @nrwl/[email protected]" has unmet peer dependency "prettier@^1.19.1".

warning " > @nrwl/[email protected]" has incorrect peer dependency "prettier@^1.19.1".

warning: LF will be replaced by CRLF in .editorconfig.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .prettierignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .prettierrc.
...

warning "@nrwl/angular > @nrwl/[email protected]" has unmet peer dependency "cypress@>= 3 < 5".
warning "@nrwl/angular > [email protected]" has unmet peer dependency "rxjs@^6.4.0".
warning "@nrwl/angular > @nrwl/cypress > @cypress/[email protected]" has unmet peer dependency "webpack@^4.18.1".
warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor > [email protected]" has unmet peer dependency "webpack@>=2".

angular bug

Most helpful comment

The issue here is that there is no @angular packages because no application has been generated.

https://github.com/snebjorn/nx-test/blob/master/package.json#L32

We should add those packages when generating an angular library.

For now, to trigger this manually, you can run:

nx g @nrwl/angular:ng-add

>All comments

The issue here is that there is no @angular packages because no application has been generated.

https://github.com/snebjorn/nx-test/blob/master/package.json#L32

We should add those packages when generating an angular library.

For now, to trigger this manually, you can run:

nx g @nrwl/angular:ng-add
Was this page helpful?
0 / 5 - 0 ratings