1

I'm using swiper module which on installation runs fine but when I re serve the project then I'm stuck with error: 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

Here is the result of my 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
Black Mamba
  • 13,632
  • 6
  • 82
  • 105
  • Is it OK to downgrade ngx-swiper-wrapper version to 3? – P.S. Jan 27 '18 at 14:29
  • Yes I can but I don't know what particular version is their version 3 their versioning is like 5.3.0 the one I've installed so Don't know what their version 3 is.Moreover I think the error is regarding angular version which is the only 4 I see (lol) – Black Mamba Jan 27 '18 at 14:32

1 Answers1

2

After opening an issue I found that this error is due to the versioning problem as most of the plugins in the version 5 are not compatible with version 4.

Either Update your project from 4 to version 5 using this it might be time-consuming as your projects might have dependencies that are v4 compatible only so I preferred not to do that.

I ended up installing an older version of the plugin using:

npm install ngx-swiper-wrapper@prev --save

Similarly installing an working old version can be installed using the releases part in GitHub or going through the doc as most plugins give references to older versions.

Similarly, for another plugin, I faced the issue which was solved using the same approach.Consider this issue

Update: After a few months I would like to suggest upgrading your project itself. Just create a new blank project after upgrading to the latest angular version(6 as of now) and copy your src there and install each plugin separately by looking at your package.json this will install the latest versions of your plugins(Although there might be functionality change with new versions so don't forget to check them too). I know it feels hard first but I can assure you it won't cost you that much as much finding suitable versions for your old project.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Black Mamba
  • 13,632
  • 6
  • 82
  • 105