目标入口点"@vcd/ui-components"缺少依赖项:



npm starthttps://github.com/juanmendes/vmware-cloud-director-ui-components对于名为CCD_ 2的分支。如果运行master分支,则不会出现任何错误。

ERROR in The target entry-point "@vcd/ui-components" has missing dependencies:
- @angular/core
- @clr/angular
- @angular/common
- rxjs/internal-compatibility
- @angular/platform-browser
- @angular/core/testing
- @angular/forms
- @angular/router
- rxjs
- rxjs/operators
- @clr/angular/data/datagrid/interfaces/filter.interface

在这个最后的错误之前,我还看到了以下错误消息:

Warning: Entry point '@vmw/ng-live-docs' contains deep imports into '/Users/jmendes/git/github/juan-core-ui/node_modules/prismjs/components/prism-scss', '/Users/jmendes/git/github/juan-core-ui/node_modules/prismjs/components/prism-typescript'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@vmw/plain-js-live-docs' contains deep imports into '/Users/jmendes/git/github/juan-core-ui/node_modules/lit-html/directives/unsafe-html'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Warning: Entry point '@vcd/ui-components' contains deep imports into '/Users/jmendes/git/github/juan-core-ui/node_modules/@clr/angular/data/datagrid/interfaces/filter.interface'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

如果我让同事克隆回购并运行它:

git clone https://github.com/juanmendes/vmware-cloud-director-ui-components.git
cd vmware-cloud-director-ui-components;
git checkout ryan-a11y-merge-to-master;
npm ci;
npm start;

他们已经能够毫无问题地运行应用程序(并收到警告(,但我收到了上面的错误,并在localhost:4200:Cannot GET /上收到了以下消息

我尝试过的

  • 已删除node_modules和dist文件夹
  • npm缓存清理
  • npm unlink@angular/core(包文件夹中的两个步骤和包含它的项目(
  • npm取消链接@vcd/ui组件(两个步骤(
  • 完全删除node、npm、nmv并重新安装

解决方案

如果我禁用Ivy编译,那么它会抱怨,因为它使用的一个包(@vmw/live-docs(没有为一些动态创建的组件声明entryComponents(因为Ivy编译中不需要它们(。

为了解决这个问题,我修改了@vmw/live-docs中的代码,使其具有entryComponents,并重新构建了它,将其dist文件夹复制到我当前应用程序中的node_modules中。这让我可以在非常春藤模式下运行应用程序,这不是我想要的

我还能尝试什么

我没有什么可以尝试的,欢迎任何建议。

之所以发生这种情况,是因为我有一个带有过时引用的~/node_modules/@vcd/ui-components

似乎节点模块的分辨率正在上升,并试图使用该版本,而不是我在~/github/vmware-cloud-director-ui-components/tsconfig.json中配置的版本

"compilerOptions": {
"paths": {
"@vcd/ui-components": [
"../../dist/components"
]
}
},

删除node_modules文件夹修复了我的问题

最新更新