ERROR in Error: Metadata version mismatch for module ngx-swiper-wrapper found version 4, expected 3
ERROR in Error: Metadata version mismatch for module ngx-swiper-wrapper found version 4, expected 3
我正在使用安装时运行良好的 swiper 模块,但是当我重新为该项目提供服务时,我遇到了错误:
The plugin link
ERROR in Error: Metadata version mismatch for module
E:/xampp/htdocs/havemybooks/node_modules/ngx-swiper-wrapper/dist/ng
x-swiper-wrapper.d.ts, found version 4, expected 3, resolving symbol
ComponentModule in E:/xampp/htdocs/havemybooks/src/
app/component/component.module.ts, resolving symbol ComponentModule in
E:/xampp/htdocs/havemybooks/src/app/component/com ponent.module.ts
这是我的ng -v
的结果
@angular/cli: 1.4.2
node: 6.10.3
os: win32 x64
@angular/animations: 4.4.5
@angular/common: 4.4.5
@angular/compiler: 4.4.5
@angular/core: 4.4.5
@angular/forms: 4.4.5
@angular/http: 4.4.5
@angular/platform-browser: 4.4.5
@angular/platform-browser-dynamic: 4.4.5
@angular/router: 4.4.5
@angular/cli: 1.4.2
@angular/compiler-cli: 4.4.5
@angular/language-service: 4.4.5
typescript: 2.3.4
打开issue后我发现这个错误是由于版本控制问题造成的,因为版本5中的大多数插件与版本4不兼容。
使用 将您的项目从版本 4 更新到版本 5 这可能很耗时,因为您的项目可能具有仅兼容 v4 的依赖项,所以我不想这样做。
我最终使用以下方法安装了旧版本的插件:
npm install ngx-swiper-wrapper@prev --save
类似地,可以使用 GitHub
中的 releases
部分安装可以正常工作的旧版本,或者通过文档进行安装,因为大多数插件都提供对旧版本的引用。
同样,对于另一个插件,我遇到了使用相同方法解决的问题。Consider this issue
更新: 几个月后,我想建议升级您的项目本身。升级到最新的 angular 版本(截至目前为 6)后,只需创建一个新的空白项目,然后将 src
复制到那里,然后通过查看 package.json
分别安装每个插件,这将安装你的插件的最新版本(虽然新版本可能会有功能变化,所以不要忘记检查它们)。我知道一开始感觉很难,但我可以向你保证,为你的旧项目找到合适的版本不会花费你那么多钱。
我正在使用安装时运行良好的 swiper 模块,但是当我重新为该项目提供服务时,我遇到了错误: The plugin link
ERROR in Error: Metadata version mismatch for module E:/xampp/htdocs/havemybooks/node_modules/ngx-swiper-wrapper/dist/ng x-swiper-wrapper.d.ts, found version 4, expected 3, resolving symbol ComponentModule in E:/xampp/htdocs/havemybooks/src/ app/component/component.module.ts, resolving symbol ComponentModule in E:/xampp/htdocs/havemybooks/src/app/component/com ponent.module.ts
这是我的ng -v
@angular/cli: 1.4.2
node: 6.10.3
os: win32 x64
@angular/animations: 4.4.5
@angular/common: 4.4.5
@angular/compiler: 4.4.5
@angular/core: 4.4.5
@angular/forms: 4.4.5
@angular/http: 4.4.5
@angular/platform-browser: 4.4.5
@angular/platform-browser-dynamic: 4.4.5
@angular/router: 4.4.5
@angular/cli: 1.4.2
@angular/compiler-cli: 4.4.5
@angular/language-service: 4.4.5
typescript: 2.3.4
打开issue后我发现这个错误是由于版本控制问题造成的,因为版本5中的大多数插件与版本4不兼容。
使用
我最终使用以下方法安装了旧版本的插件:
npm install ngx-swiper-wrapper@prev --save
类似地,可以使用 GitHub
中的 releases
部分安装可以正常工作的旧版本,或者通过文档进行安装,因为大多数插件都提供对旧版本的引用。
同样,对于另一个插件,我遇到了使用相同方法解决的问题。Consider this issue
更新: 几个月后,我想建议升级您的项目本身。升级到最新的 angular 版本(截至目前为 6)后,只需创建一个新的空白项目,然后将 src
复制到那里,然后通过查看 package.json
分别安装每个插件,这将安装你的插件的最新版本(虽然新版本可能会有功能变化,所以不要忘记检查它们)。我知道一开始感觉很难,但我可以向你保证,为你的旧项目找到合适的版本不会花费你那么多钱。