0

I get the following error

Error: Metadata version mismatch for module /www/projects/project/node_modules/@ionic-native/dialogs/index.d.ts, found version 4, expected 3 … when I run

$ ionic cordova build browser --prod It’s working when I build without --prod

Env. info

$ ionic info cli packages: (projects/project/node_modules)

@ionic/cli-utils  : 1.18.0
ionic (Ionic CLI) : 3.18.0

global packages:

cordova (Cordova CLI) : 6.5.0 

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : browser 4.1.0
Ionic Framework    : ionic-angular 3.6.0

System:

Node : v7.10.1
npm  : 4.2.0 
OS   : Linux 4.4

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

I need to publish new feature that uses Dialogs module by tomorrow so I would really appreciate any help…

thanks…

Sašo Kovačič
  • 891
  • 1
  • 9
  • 21

2 Answers2

0

I installed @ionic-native/dialogs plugin and after that couldn't build my app for production anymore... Later I found out that npm installed the latest (incompatible) version of the plugin (4.4.0) but all other native plugins were at version 3.12.1... So I changed the new plugin version in the package.json file to 3.12.1 and installed it... This fixed my problem...

Sašo Kovačič
  • 891
  • 1
  • 9
  • 21
0

I was facing a similar issue with all native plugins used in my project. All I did was uninstall and install the node modules for the corresponding plugins.

example:

$ npm uninstall --save @ionic-native/geolocation

$ npm install --save @ionic-native/geolocation
chethan
  • 32
  • 7
  • this is correct but if you have older angular installed (in my case angular 4) you first need to upgrade it to the lastest version (in my case version 5). I didn't have time to upgrade everything and fix potential bugs that could arise after the upgrade... – Sašo Kovačič Nov 24 '17 at 12:12