gpt4 book ai didi

angular - angular7 中的 ng2-dragula 编译失败

转载 作者:行者123 更新时间:2023-12-05 00:59:35 24 4
gpt4 key购买 nike

使用默认启动 Angular-Cli 7 项目并按照此处描述的步骤操作:https://github.com/valor-software/ng2-dragula设置 ng2-dragula,编译失败。

ng2-dragula 2.1.0(最新)。

详细信息:

ERROR in node_modules/ng2-dragula/dist/MockDrake.d.ts(41,5): error      TS2416:    Property 'on' in type 'MockDrake' is not assignable to the same property in base type 'DrakeWithModels'.
Type '(event: string, callback: Function) => void' is not assignable to type '(events: string, callback: Function) => Drake'.
Type 'void' is not assignable to type 'Drake'.

i 「wdm」: Failed to compile.

开发。系统信息:

Angular CLI: 7.0.3
Node: 8.11.4
OS: win32 x64
Angular: 7.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.3
@angular-devkit/build-angular 0.10.3
@angular-devkit/build-optimizer 0.10.3
@angular-devkit/build-webpack 0.10.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@angular/cli 7.0.3
@ngtools/webpack 7.0.3
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1

最佳答案

你可以通过安装@types/dragula来解决这个问题:

npm install @types/dragula@^2.1.33

Dragula 2.1.0 需要 2.1.33。

在 github 上查看此问题以获取更多信息: Property 'on' in type 'MockDrake' is not assignable to the same property in base type 'DrakeWithModels

关于angular - angular7 中的 ng2-dragula 编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53064576/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com