Aks*_*ayP 2 javascript node.js npm angular
我安装了ng-select2 包。而且我收到此错误,并且代码在“ng serve”之后无法编译。
操作系统 Windows 7
ERROR in d:/PATH-TO-PROJECT-FOLDER/node_modules/@types/select2/index.d.ts (233,49): 'JQuery' only refers to a type, but is being used as a namespace here.
ERROR in D:/PATH-TO-PROJECT-FOLDER/node_modules/ng-select2/ng-select2/ng-select2.component.ts (188,18): Cannot find name 'Select2Options'.
ERROR in /src/app/pages/dashboard/dashboard.component.ts (91,19): Cannot find name 'Select2Options'.
// Dashboard component ts(91, 19) error + I've also added import to it:
public options: Select2Options;
Run Code Online (Sandbox Code Playgroud)
我试过的解决方案是:
如 github 问题所述:在最新版本 4.0.45 中,接口 Select2Options 已删除/重命名为 Options
为了解决这个问题,我只需通过运行 npm install @ types/select2@4.0.44 --save 将包降级到 4.0.44,这对我有用。
https://github.com/NejcZdovc/ng2-select2/issues/124
| 归档时间: |
|
| 查看次数: |
2793 次 |
| 最近记录: |