Cannot find module '@ionic-native/nativeaudio'


#1

Hi,

I just installed the plugin ‘Native Audio’ and imported it into my home.ts file. However when I run the app using ‘ionic serve’ it will gives me an error:

Cannot find module '@ionic-native/nativeaudio'.

Any ideas?

app.module.ts

import { AppAvailability } from ‘@ionic-native/app-availability’;
import { NativeAudio } from ‘@ionic-native/nativeaudio’;

@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
AppAvailability,
NativeAudio
]
})
export class AppModule {}

home.ts

import { AppAvailability } from ‘@ionic-native/app-availability’;
import { NativeAudio } from ‘@ionic-native/native-audio’;

@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {


#2

So I figured out the problem, needed to add a dash to the import (between native and audio):

import { NativeAudio } from ‘@ionic-native/native-audio’;