angular - ng2-date-picker : node_modules/ng2-date-picker/ng2-date-picker. d.ts,找到版本 4,预期为 3,解析符号 NavigationTabModule

标签 angular

当我在运行 npm install 后克隆一个 angular 4 项目时,我有 angular-cli 1.5.6,当使用 ng serve 服务项目时,我得到了这个错误 ng2-日期选择器

ERROR in C:/Users/.../node_modules/ng2-date-picker/common/types/selection-evet.enum..d.ts (2,13): In ambient enum declarations member initializer must be constant expression.

ERROR in C:/Users/.../node_modules/ng2-date-picker/common/types/selection-evet.enum..d.ts (3,17): In ambient enum declarations member initializer must be constant expression.

ERROR in Metadata version mismatch for module C:/Users/.../node_modules/ng2-date-picker/ng2-date-picker.d.ts, found version 4, expected 3, resolving symbol NavigationTabModule in C:/Users/.../src/app/navigation-tab/navigation-tab.module.ts, resolving symbol NavigationTabModule in C:/Users/.../src/app/navigation-tab/navigation-tab.module.ts

package.json 文件中我有 "ng2-date-picker": "^2.8.1"

最佳答案

解决我的问题的解决方案是摆脱 package.json 中 ng2-date-picker 版本中的 ^

"ng2-date-picker": "^2.8.1" 替换为 "ng2-date-picker": "2.8.1" 修复了错误。

关于angular - ng2-date-picker : node_modules/ng2-date-picker/ng2-date-picker. d.ts,找到版本 4,预期为 3,解析符号 NavigationTabModule,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51503861/

相关文章:

javascript - 如何检查javascript数组是否包含具有特定值的属性,如果是则返回true

angular - 如何加载页脚之前的内容?

Angular 2 SPA Azure Active Directory JWT 问题

c# - 从 Angular 2 调用 WCF 服务

javascript - 如何在没有浏览器同步和 Node 的情况下运行 Angular 2 应用程序?

angular - 隐藏基于 Authentication Angular 2 的链接

angular - NgRx:监听服务中的状态变化而不是使用 Effect

angular - 由 .Net Core 托管的 Angular 应用程序中的 robots.txt 文件

angular - 发生未处理的异常 : Could not find the implementation for builder @angular-devkit/build-angular:dev-server

angular - 自定义 angular2 表单输入组件,在组件内具有两种方式绑定(bind)和验证