Runtime Error: Cannot find module "@ionic-native/status-bar"

I keep getting this error when trying to serve my project. Not sure what to do to fix it.

1 Like

Hi @jttalking,

First of all I hope you have installed the StatusBar plugin in your application.

$ ionic plugin add cordova-plugin-statusbar
$ npm install --save @ionic-native/status-bar

could you please check in app.component.ts file that below mentioned code is added or not.

import { StatusBar } from ‘@ionic-native/status-bar’;

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready().then(() => {
	  statusBar.styleDefault();
	} );
 }

and also check for app.module.ts for below mentioned code

import { StatusBar } from ‘@ionic-native/status-bar’;

In constructor

providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]

Hope this will solve your issue.

Feel free to mark it as a solution and you can always like the answer by clicking heart icon.

1 Like

As you’re using ionic 3 plus angular, probably, @ionic-native angular modules have changed to /ngx for supporting the other technologies (es2015+/typescript/etc) - you can read about it here: https://ionicframework.com/docs/native/

Just change import’s path as so:

import { StatusBar } from ‘@ionic-native/status-bar/ngx’;

And we’ll all go well. This applies to any current ionic-native module.

Please Find Solution Here : https://stackoverflow.com/questions/54361396/ionic-3-error-install-native-plugin-after-ionic-4-release/54365080#54365080

Or above on my answer… =)