2017-04-22 53 views
1

我試圖用--livereload選項我Android設備上運行一個全新的Ionic2應用程序,但我得到的錯誤。Ionic2 - LiveReload不工作

設置命令:

$ ionic start ionic2-speed-test-run --v2 
$ cd ionic2-speed-test-run/ 
$ cordova platform add android 

如果我做的:

$ ionic run android 

應用程序正常運行我Android設備上,但如果我這樣做:

$ ionic run android -l 

然後我得到的跟隨着錯誤輸出:

$ ionic run android -l 

> [email protected] ionic:serve D:\ionic2\ionic2-speed-test-run 
> ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.1.202" "--iscordovaserve" "--nobrowser" 

[17:37:09] ionic-app-scripts 1.3.0 
[17:37:09] watch started ... 
[17:37:09] 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 10.0.14393 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--runLivereload" "--isPlatformServe" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.1.202" "--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" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.1.202" "--iscordovaserve" "--nobrowser"` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] ionic:serve script 'ionic-app-scripts serve "--v2" "--runLivereload" "--isPlatformServe" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.1.202" "--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 package, 
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" "--livereload" "--port" "8101" "--livereload-port" "35730" "--address" "192.168.1.202" "--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!  D:\ionic2\ionic2-speed-test-run\npm-debug.log 

以防萬一,環境信息在這裏:

$ ionic info 

Your system information: 
Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.1 
Ionic CLI Version: 2.2.2 
Ionic App Lib Version: 2.2.1 
Ionic App Scripts Version: 1.3.4 
ios-deploy version: Not installed 
ios-sim version: Not installed 
OS: Windows 10 
Node Version: v6.10.2 
Xcode version: Not installed 

如何使--livereload作品的任何想法?

回答

2

這種類型的錯誤發生在您使用實際加載的具有相同的IP地址時。只要殺死其他正在運行的離子應用程序並嘗試運氣。

,如果你還是收到這個錯誤只是重啓系統,並再次嘗試。

最後,但至少

升級我的科爾多瓦和離子到最新版本,那麼它的偉大的工作。只是把它當成最後的希望。

我用最後的選擇我的離子的應用程序。

+0

重新啓動系統,只需要終止所有節點進程。 – Arad

0

此消息已經發生時,現場重裝使用中的網址。可能是你正在運行$ ionic serve命令,並嘗試$ ionic run android -l關閉所有正在運行的程序,然後再試一次。如果問題沒有解決,請嘗試重新啓動系統。它將強制關閉你的所有應用程序。您可以嘗試將Ionic降級到版本2.

+0

感謝,它的工作原理! – davidesp