简体   繁体   English

无法在 Nx monorepo 上创建 Angular 库

[英]Can't create an Angular Library on Nx monorepo

I have a monorepo with an Angular App.我有一个带有 Angular 应用程序的 monorepo。 I'm trying to create a angular lib on my Nx monorepo;我正在尝试在我的 Nx monorepo 上创建一个 angular 库; to use it later according to DDD with the command npx nx g @nrwl/angular:lib infrastructure --verbose and throws the following error:稍后根据 DDD 使用命令npx nx g @nrwl/angular:lib infrastructure --verbose并引发以下错误:

[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但是如果我运行npx nx g @nrwl/workspace:lib domain然后工作,但不是 Angular 库

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节点JS:16 Windows:10

@alambertt did you get a solution for this? @alambertt 您对此有解决方案吗? I am facing the same problem and am not able to create an angular library.我面临同样的问题,无法创建 angular 库。 So far, I'm able to create an nx library just fine.到目前为止,我能够很好地创建一个 nx 库。 But not an angular library.但不是 angular 库。 Happened after some nx workspace migrations.在一些 nx 工作区迁移之后发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM