Can't create an Angular Library on Nx monorepo

Viewed 78

I have a monorepo with an Angular App. I'm trying to create a angular lib on my Nx monorepo; to use it later according to DDD with the command npx nx g @nrwl/angular:lib infrastructure --verbose and throws the following error:

[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic
Project extension with invalid name (files) found.
Project extension with invalid name (files) found.
[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic
Project extension with invalid name (files) found.
Project extension with invalid name (files) found.
[NX] Angular devkit called `writeWorkspace`, this may have had unintended consequences in workspace.json
[NX] Double check workspace.json before proceeding
[NX] Angular devkit readJsonWorkspace fell back to Nx workspaces logic
Project extension with invalid name (files) found.
Project extension with invalid name (files) found.
SchematicsException [Error]: Project "infrastructure" does not exist.
    at C:\Users\angel\Documents\Develop\Projects\MUNDO\Web App\evemundo-web-app\node_modules\@schematics\angular\component\index.js:99:19
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

 >  NX   Project "infrastructure" does not exist.


Error: Project "infrastructure" does not exist.
    at C:\Users\angel\Documents\Develop\Projects\MUNDO\Web App\evemundo-web-app\node_modules\@schematics\angular\component\index.js:99:19
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

But if I run npx nx g @nrwl/workspace:lib domain then works, but is not an Angular library

Library Versions

"@angular/animations": "~14.2.0",
    "@angular/cdk": "^14.2.0",
    "@angular/common": "~14.2.0",
    "@angular/compiler": "~14.2.0",
    "@angular/core": "~14.2.0",
    "@angular/forms": "~14.2.0",
    "@angular/platform-browser": "~14.2.0",
    "@angular/platform-browser-dynamic": "~14.2.0",
    "@angular/router": "~14.2.0",
    "devextreme": "^22.1.4",
    "devextreme-angular": "^22.1.4",
 "@angular-devkit/build-angular": "~14.2.0",
    "@angular-eslint/eslint-plugin": "~14.0.0",
    "@angular-eslint/eslint-plugin-template": "~14.0.0",
    "@angular-eslint/template-parser": "~14.0.0",
    "@angular/cli": "~14.2.0",
    "@angular/compiler-cli": "~14.2.0",
    "@angular/language-service": "~14.2.0",
 "@nrwl/angular": "14.6.5",
    "@nrwl/cli": "14.6.5",
    "@nrwl/cypress": "14.6.5",
    "@nrwl/eslint-plugin-nx": "14.6.5",
    "@nrwl/jest": "14.6.5",
    "@nrwl/linter": "14.6.5",
    "@nrwl/nx-cloud": "14.6.2",
    "@nrwl/workspace": "14.6.5",
    "@types/jest": "28.1.1",
    "@types/node": "16.11.7",

NodeJS: 16 Windows: 10

1 Answers

This is probably not the answer you are looking for - but downgrading to nx version 14.5.6 (I was at nx 14.7.x) fixed the issue for me.

Related