2017-05-07 71 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 –