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


I am getting this error in my service

Cannot find name 'Network'.

I have installed the ionic plugin add cordova-plugin-network-information

and here is my service

import { Network } from '@ionic-native/network';

export class DataService {
     constructor(private network: Network) { }


You need to install the npm package too:

npm install @ionic-native/network --save


thanks @joshmorony this fixes Cannot find name 'Network' but I am still getting this Uncaught Error: Cannot find module "@ionic-native/core"

I just wanted to check network status before making any HTTP request, any other way doing this, currently I am adding this check in my HTTP wrapper DataService.


You also need to import into your app.module.ts file and add it as a provider there.


I ran this command and it gives me this error.
’-- UNMET PEER DEPENDENCY typescript@2.0.9


try to call it after device ready event


which one has been add in app.module.ts


After I imported Network in app.module.ts and added Network in providers list, it gives the error

"Type ‘NetworkOriginal’ is not assignable to type ‘Provider’.
_ Type ‘NetworkOriginal’ is missing the following properties from type ‘FactoryProvider’: provide, useFactory [2322]"_