问题
I am trying to use NgxPaginationModule in my Angular5 project cannot resolve symbol NgxPaginationModule , i followed all step as documented
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { GlobalModule } from './global/global.module';
import { ProtectedModule} from './protetcted/protect-module.component';
import { AppRoutingModule } from './app.routing.module';
import {NgxPaginationModule} from 'ngx-pagination';//cannot resolve symbol NgxPaginationModule
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
GlobalModule,
ProtectedModule,
AppRoutingModule,
NgxPaginationModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
I checked node modules and ngx-pagination folder exist can any one suggest what causing this error?
回答1:
This same thing is happening to me during an Azure CI build:
Could not resolve ngx-pagination relative to D:/a/7/s/src/app/app.module.ts. Cannot find module 'ngx-pagination
app.module.ts:
// import { NgxPaginationModule } from 'ngx-pagination'; // <-- import the module imports: [ BrowserModule, FormsModule, ReactiveFormsModule, HttpClientModule, AppRoutingModule, NgbModule.forRoot(), // NgxPaginationModule ],
Works fine locally.
来源:https://stackoverflow.com/questions/50060938/cannot-resolve-symbol-ngxpaginationmodule