0

我只是安装了 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';'.

我不知道如何解决这个问题,因为我用谷歌搜索过,但没有发现任何有用的东西。这是我的 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 { }

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

4

0 回答 0