我该如何修复NativeScript错误:无法找到模块:“ nativescript-pager / angular”

时间:2018-12-13 09:11:50

标签: android nativescript nativescript-angular nativescript-plugin

我只安装了nativescript-pager插件,当我运行命令tns Preview时,出现ff错误:

Successfully synced changes for platform android.
LOG from device Infinix X510: com.tns.NativeScriptException:

Error calling module function

Error calling module function

Error: com.tns.NativeScriptException: Failed to find module: "nativescript-pager/angular", relative to: app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:553)
    com.tns.Runtime.run(Runtime.java:545)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:4852)
    android.app.ActivityThread.access$1500(ActivityThread.java:178)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1531)
    android.os.Handler.dispatchMessage(Handler.java:111)
    android.os.Looper.loop(Looper.java:194)
    android.app.ActivityThread.main(ActivityThread.java:5631)
    java.lang.reflect.Method.invoke(Native Method)
    java.lang.reflect.Method.invoke(Method.java:372)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
File: "<unknown>, line: 1, column: 265

StackTrace:
        Frame: function:'require', file:'', line: 1, column: 266
        Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/app/app.module.js', line: 7, column: 17
        Frame: function:'require', file:'', line: 1, column: 266
        Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/main.js', line: 5, column: 20
        Frame: function:'require', file:'', line: 1, column: 266
src/app/app.module.ts(7,29): error TS2307: Cannot find module 'nativescript-pager/angular';'.

我不知道如何解决此问题,因为我已经用Google搜索,但没有发现任何有用的东西。 这是我的app.module.ts代码:

从“ @ angular / core”导入{NgModule,NO_ERRORS_SCHEMA};     从“ nativescript-angular / nativescript.module”导入{NativeScriptModule};

import { AppRoutingModule } from "./app-routing.module";
import { AppComponent } from "./app.component";

import { PagerModule } from "nativescript-pager/angular";
import { TNSCheckBoxModule } from 'nativescript-checkbox/angular';

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule,
        AppRoutingModule,
        PagerModule,
        TNSCheckBoxModule,
        NativeScriptFormsModule,
        NativeScriptHttpClientModule
    ],
    declarations: [
        AppComponent,
        ....
    ],
    providers: [],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
/*
Pass your application module to the bootstrapModule function located in main.ts to start your app
*/
export class AppModule { }

有点让我沮丧。请帮忙 !!!。谢谢!

0 个答案:

没有答案