2016-10-12 104 views
0

我有錯誤,當我運行「離子運行android」或「離子建設android」在我的離子2應用程序 這是我得到的錯誤。我只是想在Android的模擬器中看到我的應用程序。 我試圖做出新的離子2項目,但它是同樣的問題。離子2:離子運行android顯示錯誤

Running 'build:before' npm script before build 
> [email protected] build C:\Users\Adir\MyApps\tasklist 
> ionic-app-scripts build --rollup ./config/rollup.config.js 
[20:16:33] ionic-app-scripts 0.0.30 
[20:16:33] build prod started ... 
[20:16:33] clean started ... 
[20:16:33] clean finished in 24 ms 
[20:16:33] copy started ... 
[20:16:33] ngc started ... 
[20:16:33] lint started ... 
[20:16:33] copy finished in 182 ms 
[20:16:34] lint finished in 770 ms 
[20:16:52] ngc finished in 18.71 s 
[20:16:52] bundle prod started ... 
[20:16:52] bundle prod failed: Could not resolve entry (/app/main.prod.ts) 

[20:16:52] Error: Could not resolve entry (/app/main.prod.ts) 
    at C:\Users\Adir\MyApps\tasklist\node_modules\rollup\dist\rollup.js:8635:28 
    at process._tickCallback (internal/process/next_tick.js:103:7) 

Error running ionic app script "build": Error: Could not resolve entry (/app/main.prod.ts) 



npm 
ERR! Windows_NT 10.0.14393 

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build" 
npm ERR! node v6.7.0 
npm ERR! npm v3.10.3 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] build: `ionic-app-scripts build --rollup ./config/rollup.config.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] build script 'ionic-app-scripts build --rollup ./config/rollup.config.js'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR! 
    ionic-app-scripts build --rollup ./config/rollup.config.js 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs ionic-hello-world 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls ionic-hello-world 
npm ERR! There is likely additional logging output above. 



npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\Adir\MyApps\tasklist\npm-debug.log 

Caught exception: 
undefined 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues 


C:\Users\Adir\MyApps\tasklist> 

回答

0

這是一個常見的問題與最近離子和A2和解決main.prod.*嘗試更新你的項目的應用程序的腳本。

npm install @ionic/[email protected] 

您的錯誤消息應該隨之改變,實際上導致您的構建崩潰。如果錯誤消息更改,請使用新消息更新您的問題。

結帳了這一點以及有關此問題的詳細信息:Ionic forum

+0

嘿,我更新,這是相同的錯誤 –

+0

好吧,你運行npm 3.x? – Sam5487

+0

是的,如果這只是你正在運行的一個例子,請嘗試徹底刪除該項目並運行一個新項目。 node_modules可能有問題。 – Sam5487

0

關閉所有的離子文件夾和服務或實驗室。並再試一次,ionic cordova build android

0

嘗試使用

ionic cordova run android 

ionic cordova platform remove android 

ionic cordova run android 

如果你有MAC系統必須使用sudo像

sudo ionic cordova run android