【问题标题】:Error when generating new angular app in Nx workspace在 Nx 工作区中生成新的 Angular 应用程序时出错
【发布时间】:2022-11-10 14:56:13
【问题描述】:

从 Angular/Nx 12->14 升级后尝试在 Nx 工作区中生成 Angular 应用程序时出现以下错误:

SchematicsException [Error]: Project "name-of-app" does not exist.

我们使用的命令是:

npx nx g @nrwl/angular:application name-of-app  

查看源代码,错误似乎是在调用组件生成器时发生的。我们已经为组件生成器编写了一个自定义原理图,但我不确定为什么会导致这个问题。

【问题讨论】:

    标签: angular nrwl angular-schematics nx-workspace


    【解决方案1】:

    我们的 Tree 组件生成器代码中存在类型不匹配。事实证明,当我们在 Angular 14 上时,@compodoc/compodoc 为 @angular-devkit/schematics 引入了 v13.x.x。由于它是第一个需要原理图的 dep,它的版本覆盖了其他版本。解决方法是通过将原理图包含在我们的包中来强制将原理图升级到 v14。

    npm install --save-dev @angular-devkit/schematics@^14.2.7
    // this step may or may not be required
    npm install --save-dev @schematics/angular@^14.2.7
    

    【讨论】:

      猜你喜欢
      • 2022-06-12
      • 2021-11-21
      • 2020-03-21
      • 2021-03-07
      • 1970-01-01
      • 2020-01-21
      • 2022-09-30
      • 2022-01-06
      • 2022-10-08
      相关资源
      最近更新 更多