离子cordova构建android无法找到模块' ../ pages / Wallet /'

时间:2018-05-17 06:19:02

标签: android amazon-web-services cordova ubuntu ionic3

我是Ionic的新手,在构建时遇到以下错误:

jenkins @ ip-172-31-22-20:〜/ workspace / TestAngular $ ionic cordova build android

Running app-scripts build: --platform android --target cordova
[06:08:19]  build dev started ...
[06:08:19]  clean started ...
[06:08:19]  clean finished in 1 ms
[06:08:19]  copy started ...
[06:08:19]  deeplinks started ...
[06:08:19]  deeplinks finished in 51 ms
[06:08:19]  transpile started ...
[06:08:23]  typescript: src/app/app.component.ts, line: 12
            Cannot find module '../pages/Wallet/'.

      L11:  import {DisclaimerPage} from '../pages/disclaimer/disclaimer'
      L12:  import {WalletPage} from '../pages/Wallet/'
      L13:  import {OrderhistoryPage} from '../pages/orderhistory/orderhistory'

[06:08:23]  typescript: src/app/app.module.ts, line: 15
            Cannot find module '../pages/Wallet/wallet'.

      L14:  import {DisclaimerPage} from '../pages/disclaimer/disclaimer'
      L15:  import {WalletPage} from '../pages/Wallet/wallet'
      L16:  import {OrderhistoryPage} from '../pages/orderhistory/orderhistory'

Error: Failed to transpile program
    at new BuildError (/var/lib/jenkins/workspace/TestAngular/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at /var/lib/jenkins/workspace/TestAngular/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
    at new Promise (<anonymous>)
    at transpileWorker (/var/lib/jenkins/workspace/TestAngular/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
    at Object.transpile (/var/lib/jenkins/workspace/TestAngular/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
    at /var/lib/jenkins/workspace/TestAngular/node_modules/@ionic/app-scripts/dist/build.js:109:82
    at <anonymous>
[06:08:23]  copy finished in 3.76 s

它说&#34;找不到模块&#39; ../ pages / Wallet /&#39;。&#34;

如何获得此模块?

我试过了:

jenkins@ip-172-31-22-20:~/workspace/TestAngular$  cordova platform remove android
Removing platform android from config.xml file...
Removing android from cordova.platforms array in package.json

得到同样的错误:

jenkins@ip-172-31-22-20:~/workspace/TestAngular$ ionic cordova build android
> cordova platform add android --save
Using cordova-fetch for cordova-android@~7.0.0

Adding android project...

Creating Cordova project for the Android platform:

        Path: platforms/android
        Package: io.ionic.starter

PS:

I am using ionic 3 on ubuntu aws instance 
Ionic Framework: 3.9.2
Ionic App Scripts: 3.1.9
Angular Core: 5.2.10
Angular Compiler CLI: 5.2.10
Node: 9.6.1
OS Platform: Linux 3.13
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

1 个答案:

答案 0 :(得分:1)

在L12上,你忘了提及ts文件的名称。

应该如下:

  

从&#39; ../ pages / Wallet / wallet&#39;

导入{WalletPage}