ionic android not build for testing。

时间:2018-11-03 16:56:50

标签: cordova ionic-framework npm ionic3

当我在npm上运行命令ionic cordova run android --device时。我收到以下错误。但事实是,ionic serve可以正常工作,而不会给出任何错误或警告。另外,我认为页面“ transfercredit”没有任何问题,因为在创建此页面之前我遇到了相同的错误。该错误仅显示其错误中的最后一页。我不知道这里出了什么问题。谢谢。

[20:56:25]  ionic-app-script task: "build"
[20:56:25]  Error: ./src/pages/transfercredit/transfercredit.ts Module build failed: Error: ENOENT: no such file or
            directory, open 'C:\Users\Ahsan
            Ahmed\Documents\GitHub\PUHU\PUHU-v1\src\pages\transfercredit\transfercredit.js' @
            ./src/pages/transfercredit/transfercredit.module.ts 9:0-54 @ ./src lazy @
            ./node_modules/ionic-angular/util/ng-module-loader.js @ ./node_modules/ionic-angular/util/module-loader.js @
            ./node_modules/ionic-angular/components/popover/popover-component.js @ ./node_modules/ionic-angular/index.js
            @ ./src/app/app.module.ts @ ./src/app/main.ts
Error: ./src/pages/transfercredit/transfercredit.ts
Module build failed: Error: ENOENT: no such file or directory, open 'C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\src\pages\transfercredit\transfercredit.js'
 @ ./src/pages/transfercredit/transfercredit.module.ts 9:0-54
 @ ./src lazy
 @ ./node_modules/ionic-angular/util/ng-module-loader.js
 @ ./node_modules/ionic-angular/util/module-loader.js
 @ ./node_modules/ionic-angular/components/popover/popover-component.js
 @ ./node_modules/ionic-angular/index.js
 @ ./src/app/app.module.ts
 @ ./src/app/main.ts
    at new BuildError (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\webpack\lib\Compiler.js:368:12)
    at next (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-

    v1\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
        at Compiler.applyPluginsAsyncSeries1 (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\tapable\lib\Tapable.js:222:13)
        at Compiler.afterEmit (C:\Users\Ahsan Ahmed\Documents\GitHub\PUHU\PUHU-v1\node_modules\webpack\lib\Compiler.js:365:9)
    [ERROR] Command not found: ionic-app-scripts

1 个答案:

答案 0 :(得分:0)

文件名似乎有问题。确保文件名正确,因为文件名区分大小写。