2017-05-07 51 views
-1

我想在离子视图中查看我的离子项目,但它显示的只是一个白色屏幕。试图运行离子运行的Android -l -c调试我的项目,但它让我看到下面的响应运行离子运行的错误android -l -c

[email protected] ionic:serve C:\Users\GClairGC\Desktop\Angular\wasteman agementsystem ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe" "--consol elogs" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "1 92.168.8.228" "--iscordovaserve" "--nobrowser"

[21:47:32] ionic-app-scripts 1.3.0 [21:47:32] watch started ... [21:47:32] build dev started ... events.js:160 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE 0.0.0.0:53703 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at Server._listen2 (net.js:1262:14) at listen (net.js:1298:10) at net.js:1408:9 at _combinedTickCallback (internal/process/next_tick.js:83:11) at process._tickCallback (internal/process/next_tick.js:104:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:393:7) at startup (bootstrap_node.js:150:9)

npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\ node_modules\npm\bin\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--runLivere load" "--isPlatformServe" "--consolelogs" "--livereload" "--port" "8101" "--live reload-port" "35730" "--address" "192.168.8.228" "--iscordovaserve" "--nobrowser " npm ERR! node v6.10.2 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! [email protected] ionic:serve: ionic-app-scripts serve "--v2" "- -runLivereload" "--isPlatformServe" "--consolelogs" "--livereload" "--port" "810 1" "--livereload-port" "35730" "--address" "192.168.8.228" "--iscordovaserve" "- -nobrowser" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] ionic:serve script 'ionic-app-scr ipts serve "--v2" "--runLivereload" "--isPlatformServe" "--consolelogs" "--liver eload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.8.228" " --iscordovaserve" "--nobrowser"'. 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 pac kage, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe " "--consolelogs" "--livereload" "--port" "8101" "--livereload-port" "35730" "-- address" "192.168.8.228" "--iscordovaserve" "--nobrowser" 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\GClairGC\Desktop\Angular\wastemanagementsystem\npm-debug.log


的package.json

{ "name": "ionic-hello-world", "version": "0.0.0", "author": "Ionic Framework", "homepage": "http://ionicframework.com/", "private": true, "scripts": { 
    "clean": "ionic-app-scripts clean", 
    "build": "ionic-app-scripts build", 
    "ionic:build": "ionic-app-scripts build", 
    "ionic:serve": "ionic-app-scripts serve" }, 
    "dependencies": { 
    "@angular/common": "4.0.0", 
    "@angular/compiler": "4.0.0", 
    "@angular/compiler-cli": "4.0.0", 
    "@angular/core": "4.0.0", 
    "@angular/forms": "4.0.0", 
    "@angular/http": "4.0.0", 
    "@angular/platform-browser": "4.0.0", 
    "@angular/platform-browser-dynamic": "4.0.0", 
    "@angular/router": "4.0.0", 
    "@ionic-native/core": "3.4.2", 
    "@ionic-native/splash-screen": "3.4.2", 
    "@ionic-native/status-bar": "3.4.2", 
    "@ionic/storage": "2.0.1", 
    "angular2-qrcode": "^2.0.1", 
    "firebase": "^3.8.0", 
    "ionic-angular": "3.0.1", 
    "ionicons": "3.0.0", 
    "rxjs": "5.1.1", 
    "sw-toolbox": "3.4.0", 
    "zone.js": "^0.8.4" }, 
    "devDependencies": { 
    "@ionic/app-scripts": "1.3.0", 
    "typescript": "~2.2.1" }, 
    "cordovaPlugins": [ 
    "cordova-plugin-whitelist", 
    "cordova-plugin-console", 
    "cordova-plugin-statusbar", 
    "cordova-plugin-device", 
    "cordova-plugin-splashscreen", 
    "ionic-plugin-keyboard" ], 
    "cordovaPlatforms": [], 
    "description": "auth: An Ionic project" } 

的index.html

<!DOCTYPE html> 
<html lang="en" dir="ltr"> 
<head> 
    <meta charset="UTF-8"> 
    <!--<title>Loading..</title>--> 
    <base href="/"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> 
    <meta name="format-detection" content="telephone=no"> 
    <meta name="msapplication-tap-highlight" content="no"> 

    <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico"> 
    <link rel="manifest" href="manifest.json"> 
    <meta name="theme-color" content="#4e8ef7"> 

    <!-- cordova.js required for cordova apps --> 
    <script src="cordova.js"></script> 

    <!-- un-comment this code to enable service worker 
    <script> 
    if ('serviceWorker' in navigator) { 
     navigator.serviceWorker.register('service-worker.js') 
     .then(() => console.log('service worker installed')) 
     .catch(err => console.log('Error', err)); 
    } 
    </script>--> 

    <link href="build/main.css" rel="stylesheet"> 
</head> 
<body> 

    <!-- Ionic's root component and where the app will load --> 
    <ion-app></ion-app> 

    <!-- The polyfills js is generated during the build process --> 
    <script src="build/polyfills.js"></script> 

    <!-- The bundle js is generated during the build process --> 
    <script src="build/main.js"></script> 

</body> 
</html> 
+0

可以添加您的package.json? –

+0

您好,感谢您的答复,我已经加入吧:) –

回答

0

嗨,首先尝试运行ionic serve此试运行后ionic build android比尝试 ionic run -l -c

它会为你工作。

+0

我已经安装并运行apk文件,但所有它显示为白色空白屏幕 –

+0

这个白屏的bug也由于离子2和其他版本相关的东西,你必须仔细更新cli,ionic等版本。 – niks

+0

我该如何解决这个问题?我应该更新哪些依赖关系?谢谢 –

0

如果你有一段时间之前就开始你的poject,让我告诉你很多东西得到了改变,在你index.html应该有这些线路,以及一些其他的东西避开改变:

<!-- Polyfill needed for platforms without Promise and Collection support --> 
    <script src="build/js/es6-shim.min.js"></script> 
    <!-- Zone.js and Reflect-metadata --> 
    <script src="build/js/angular2-polyfills.js"></script> 
+0

我已经开始这个项目只有3周。 –

+0

@GillianClaireCancio您正在运行哪个版本的CLI?你能向我们展示'ionic -v'的输出吗? – Abdel

+0

@Abdel它说2.2.3 –