Admob-free with ionic


#1

I am trying to install admob-free to ionic2 project. after installing:
$ ionic cordova plugin add cordova-plugin-admob-free
$ npm install --save @ionic-native/admob-free

now running: ionic serve

I get this error:
node_modules@ionic-native\admob-free\index.js:20
import { Plugin, Cordova, IonicNativePlugin } from ‘@ionic-native/core’;
ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’

anyone can help? how should I resolve it?
Thanks.


#2

Check the version of the @ionic-native/core plugin and the @ionic-native/admob-free plugin in your package.json.
They should have the same version.


#3

Thanks for prompt response
I have:
"@ionic-native/admob-free": “^4.3.1”,
"@ionic-native/core": “^4.3.1”,

but I also have:
“cordova-plugin-admob-free”: “^0.11.0”,
and
@angular/core": “2.0.0-rc.4”

I tryied to erase the “cordova-plugin-admob-free”: “^0.11.0”,
from package json and the error still exists