【问题标题】:getting error while executing ionic App in terminal using command $ionic serve?使用命令 $ionic serve 在终端中执行 ionic App 时出错?
【发布时间】:2016-09-04 03:42:22
【问题描述】:

我已经安装了

  • 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)

有什么问题?

【问题讨论】:

  • 您是否正在运行其他可能导致冲突的应用程序?您是否尝试过使用ionic serve -p [port number] 在不同的端口上运行此应用程序,例如:ionic serve -p 8005
  • 同样的错误,更改端口号后。

标签: ionic-framework hybrid-mobile-app


【解决方案1】:

更新您的 ionic 版本

npm install -g ionic

npm install -g ionic@1.1.7

npm install -g ionic@1.1.9-beta1

【讨论】:

  • 你用的哪个版本的节点没问题?
【解决方案2】:

是的,我找到了解决方案 在使用之前我需要使用以下代码

$ ionic serve

首先,输入

$ionic address

它会显示

1)your IP-Address
2)localhost

选择第一个选项,即您的 IP 地址 现在,您可以使用 $ionic serve 它,正在工作。

谢谢大家。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-30
    • 2017-03-11
    • 2021-08-07
    • 1970-01-01
    • 1970-01-01
    • 2018-03-15
    • 1970-01-01
    相关资源
    最近更新 更多