Uncaught Error: Cannot find module "@ionic-native/core"

I am running into a runtime error of Uncaught Error: Cannot find module “@ionic-native/core” when i am trying to use Apprate Plugin.

I did run the below mentioned commands.

ionic plugin add cordova-plugin-apprate npm install --save @ionic-native/app-rate

Have you ran $ mom install --save @ionic-native/core?

I have run this command when i started my project. Anyway when i ran this command now. I got another Runtime Error stating “Error in ./MyApp class MyApp_Host - caused by: No provider for AppRate!”.

Well to fix that issue you should open up the app module file import apprate and then add apprate to the providers array of the module.

providers: [ Apprate ]

Here is my app.module.ts file

import { NgModule, ErrorHandler } from ‘@angular/core’;
import { IonicApp, IonicModule, IonicErrorHandler } from ‘ionic-angular’;
import { MyApp } from ‘./app.component’;
import {TranslateModule,TranslateStaticLoader,TranslateLoader} from ‘ng2-translate’;
import { Http, HttpModule } from ‘@angular/http’;
import {BrowserModule} from ‘@angular/platform-browser’;
import { Ng2Bs3ModalModule } from ‘ng2-bs3-modal/ng2-bs3-modal’;
import { AppRate } from ‘@ionic-native/app-rate’;

//Import Pages.
import { TabsPage } from ‘…/pages/tabs/tabs’;
import { HomePage } from ‘…/pages/home/home’;
import { OffersPage } from ‘…/pages/offers/offers’;
import { NewsPage } from ‘…/pages/news/news’;
import { ScanPage } from ‘…/pages/scan/scan’;
import { ProfilePage } from ‘…/pages/profile/profile’;
import { ResultsPage } from ‘…/pages/results/results’;
import { FirstPagePage } from ‘…/pages/first-page/first-page’;
import { LoginPage } from ‘…/pages/login/login’;
import { RegistrationPage } from ‘…/pages/registration/registration’;
import { ShowOfferPage } from ‘…/pages/show-offer/show-offer’;
import { NewsshowPage } from ‘…/pages/newsshow/newsshow’;
import { MypointsPage } from ‘…/pages/mypoints/mypoints’;
import { OtpPage } from ‘…/pages/otp/otp’;
import { PhoneNoPage } from ‘…/pages/phone-no/phone-no’;
import { EditInfoPage } from ‘…/pages/edit-info/edit-info’;
import { FeedbackPage } from ‘…/pages/feedback/feedback’;
import { RedeemPage } from ‘…/pages/redeem/redeem’;
import { ShowTimerPage } from ‘…/pages/show-timer/show-timer’;
import { FaqPage } from ‘…/pages/faq/faq’;
import { QrscanPage } from ‘…/pages/qrscan/qrscan’;
import { LoaderPage } from ‘…/pages/loader/loader’;
import { PushNotificationPage } from ‘…/pages/push-notification/push-notification’;
import { ShowNotificationPage } from ‘…/pages/show-notification/show-notification’;
import { LanguagePage } from ‘…/pages/language/language’;

//Import Providers.
import { ApiProvider } from ‘…/providers/apiprovider’;
import { LoginProvider } from ‘…/providers/login-provider’;
import { FunctionProvider } from ‘…/providers/function-provider’;

@NgModule({
declarations: [
MyApp,
OffersPage,
NewsPage,
HomePage,
ScanPage,
ProfilePage,
FirstPagePage,
LoginPage,
RegistrationPage,
TabsPage,
ResultsPage,
ShowOfferPage,
NewsshowPage,
MypointsPage,
OtpPage,
PhoneNoPage,
EditInfoPage,
FeedbackPage,
RedeemPage,
ShowTimerPage,
FaqPage,
QrscanPage,
LoaderPage,
PushNotificationPage,
ShowNotificationPage,
LanguagePage
],
imports: [
BrowserModule,
HttpModule,
Ng2Bs3ModalModule,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: (http: Http) => new TranslateStaticLoader(http, ‘assets/i18n’, ‘.json’),
deps: [Http]
}),
IonicModule.forRoot(MyApp,{tabsPlacement: ‘top’,platforms: {
android: {
tabsHideOnSubPages: true,
tabsHighlight: true,
},
ios:{
tabsHideOnSubPages: true,
tabsHighlight: true,
}
}},
// {

// links: [
//           { component: TabsPage, name: 'Home',    segment: 'home' },
//           { component: TabsPage, name: 'Offers',  segment: 'offers' },
//           { component: TabsPage, name: 'Offers',  segment: 'offers/:offerId' },
//           { component: TabsPage, name: 'Scan',    segment: 'scan' },
//           { component: TabsPage, name: 'News',    segment: 'news' },
//           { component: TabsPage, name: 'ShowNews',segment: 'shownews/:newsId' },
//           { component: TabsPage, name: 'Profile', segment: 'myProfile' },
//           { component: TabsPage, name: 'Profile', segment: 'myPoints' },
//           { component: TabsPage, name: 'Profile', segment: 'myRewards' },
//           { component: TabsPage, name: 'Profile', segment: 'myRewards/:offerId' }


//        ]



// }
)

],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
OffersPage,
NewsPage,
HomePage,
ScanPage,
ProfilePage,
FirstPagePage,
LoginPage,
RegistrationPage,
TabsPage,
ResultsPage,
ShowOfferPage,
NewsshowPage,
MypointsPage,
OtpPage,
PhoneNoPage,
EditInfoPage,
FeedbackPage,
RedeemPage,
ShowTimerPage,
FaqPage,
QrscanPage,
LoaderPage,
PushNotificationPage,
ShowNotificationPage,
LanguagePage
],

providers: [{provide: ErrorHandler, useClass: IonicErrorHandler},ApiProvider,LoginProvider,FunctionProvider,AppRate]
})
export class AppModule {

}

But now i am getting a runtime exception stating “ctorParameters.map is not a function”

Hi El_Dee565,

Thanks for helping me out. I got to know where i was doing wrong. I removed @ionic-native/apprate from the import and reverted back to the previous changes. I was not assigning AppRate.promptForRating(); to true wherever i was writing code for displaying the Rating Popup. This resolved my issue and now i am getting redirected to PlayStore. Thanks for your efforts in making me understand what went wrong.

Thanks
Pavan.

1 Like