2016-10-12 81 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