2016-05-09 30 views
0

我已經安裝了

  • Node.js的
  • 科爾多瓦
  • 離子

安裝後,我創建了一個項目作爲

$ionic start myApp 
$cd myApp 
$ionic serve 

但本地主機不加載任何東西和終端顯示以下錯誤:

The port 8100 was taken on the host localhost - using port instead 
Gulp startup tasks: 0=sass, 1=watch 
Running live reload server: undefined 
Watching: 0=www/**/*, 1=!www/lib/**/* 
Running dev server: http://localhost: 
Ionic server commands, enter: 
restart or r to restart the client app from the root 
goto or g and a url to have the app navigate to the given url 
consolelogs or c to enable/disable console log output 
serverlogs or s to enable/disable server log output 
quit or q to shutdown the server and exit 

ionic $ events.js:141 
    throw er; // Unhandled 'error' event 
^

Error: listen EADDRNOTAVAIL 192.168.1.5 
at Object.exports._errnoException (util.js:870:11) 
at exports._exceptionWithHostPort (util.js:893:20) 
at Server._listen2 (net.js:1221:19) 
at listen (net.js:1270:10) 
at net.js:1379:9 
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16) 
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10) 

什麼問題?

+0

[events.js:141 throw er; //未處理的'錯誤'事件](http://stackoverflow.com/questions/34290796/events-js-141-throw-er-unhandled-error-event) – Atula

+0

您是否正在運行其他可能導致衝突的應用程序?您是否嘗試過使用'ionic serve -p [端口號]'在不同的端口上運行此應用程序,例如:'ionic serve -p 8005' – Dexter

+0

更改端口號後出現同樣的錯誤。 –

回答

0

更新您的離子版本

npm install -g ionic 

npm install -g [email protected] 

npm install -g [email protected] 
+0

我已經有最新版本的離子,即2.0.0-beta.25 –

+0

沒有錯,您使用哪個版本的節點? –

+0

節點版本是v4.4.4 –

0

是的,我得到了解決 我需要使用

之前,使用下面的代碼
$ ionic serve 

第一,類型

$ionic address 

它會顯示

1)your IP-Address 
2)localhost 

選擇第一個選項,即您的IP地址 而現在,你可以用$離子去服務 它,現在的工作。

謝謝大家。

相關問題