Ionic 3: Cannot find module "@ionic-native/diagnostic"

Hello

I’m trying to use the Diagnostic from ionic-native but I’m getting the following error:

–> Cannot find module “@ionic-native/diagnostic”

I installed it using the following command: ionic cordova:plugin add cordova.plugins.diagnostic

In my component i’m importing it using:
import { Diagnostic } from ‘@ionic-native/diagnostic’; (tried also with just ‘ionic-native’ as in the docs with the same result)

Can anyone help me? Thank you.

I also don’t get why the class is found at the import, but when i try to make it a param of the constructor, I get the following message:

image

From what you wrote you are missing several steps of the installation:
https://ionicframework.com/docs/native/#Add_Plugins_to_Your_App_Module
+
https://ionicframework.com/docs/native/diagnostic/

1 Like

I had followed both already. But i forgot to put it in the providers :blush: thank you mate.

1 Like

Change your import
From

import { Diagnostic } from '@ionic-native/diagnostic';

To

import { Diagnostic } from '@ionic-native/diagnostic/ngx';