No provider for Network

Trying to install the Network plugin from the Ionic Native docs here: Ionic Native - Network

Followed all instructions but I keep receiving

No Provider for Network

My guess is that it’s caused by npm install error

±- UNMET PEER DEPENDENCY @angular/core@2.2.1
`-- UNMET PEER DEPENDENCY rxjs@5.2.0

Ionic version 2.2.1

Ok silly mistake. I have to add Network to the providers array in app.modules

10 Likes

i did the same silly mistake :smiley: thx

1 Like

For those who are new in the framework, yo need to open your app.module.ts file and add the following:

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

//look for @NgModule > imports and add the Network provider:
imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    HttpClientModule,
    IonicStorageModule.forRoot(),
    Network,
  ],

And then it will be ready to use your provider.