错误:目标入口点“@angular/flex-layout”缺少依赖项:-@angular/cdk/bidi

Posted

技术标签:

【中文标题】错误:目标入口点“@angular/flex-layout”缺少依赖项:-@angular/cdk/bidi【英文标题】:Error: The target entry-point "@angular/flex-layout" has missing dependencies: - @angular/cdk/bidi 【发布时间】:2021-11-16 21:18:03 【问题描述】:

我试图在 Angular 中添加 flexlayout,但每次我都收到这个错误,我改变了 npm 布局的版本,所以我该如何解决这个问题?

D:\angular\Technia-tech>ng serve
- Generating browser application bundles (phase: setup)...Compiling @angular/flex-layout/core : es2015 as esm2015
D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40
                throw new Error("The target entry-point \"" + invalidTarget.entryPoint.name + "\" has missing dependencies:\n" +
                ^

Error: The target entry-point "@angular/flex-layout" has missing dependencies:
 - @angular/cdk/bidi

    at TargetedEntryPointFinder.findEntryPoints (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
    at D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
    at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:28:29)
    at D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:59
    at SyncLocker.lock (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
    at SingleProcessExecutorSync.execute (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
    at Object.mainNgcc (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\src\main.js:74:25)
    at Object.process (D:\angular\Technia-tech\node_modules\@angular\compiler-cli\ngcc\index.js:29:23)
    at NgccProcessor.processModule (D:\angular\Technia-tech\node_modules\@ngtools\webpack\src\ngcc_processor.js:175:16)
    at D:\angular\Technia-tech\node_modules\@ngtools\webpack\src\ivy\host.js:146:18

> Blockquote

【问题讨论】:

【参考方案1】:

尝试通过执行以下命令安装flex-layout 库:

npm install --save @angular/flex-layout @angular/cdk

然后像下面这样导入它:

import  FlexLayoutModule  from '@angular/flex-layout';

// ...

@NgModule(
 imports: [ FlexLayoutModule ],
 //...
);

【讨论】:

【参考方案2】:

按照文档的建议,需要使用安装 2 个包

npm i -s @angular/flex-layout @angular/cdk

请参阅https://github.com/angular/flex-layout#getting-started。这解决了我的问题

【讨论】:

以上是关于错误:目标入口点“@angular/flex-layout”缺少依赖项:-@angular/cdk/bidi的主要内容,如果未能解决你的问题,请参考以下文章

Azure Functions 突然找不到入口点错误

在哪里设置 Shader 文件的入口点(错误 X3501)?

错误:链接:致命错误 LNK1561:入口点必须定义 C++

“注意:配置保留入口点..,但不是描述符类”错误?

如何修复 WPF 错误:“程序不包含适合入口点的静态 'Main' 方法”?

尝试运行 C++ 代码,出现“过程入口点”错误