node.js - Ember Server : "Port 4200 is already in use", 当没有进程在 4200 上运行时

标签 node.js macos networking ember.js ember.js-2

当使用 ember serve -e local 运行我的 ember 应用程序时,我得到:

Port 4200 is already in use.

这很奇怪,因为没有应用程序在 4200 上运行。我试图用 http-server 在 4200 上打开一个虚拟 HTTP 服务器。它工作得很好。当我通过命令行标志 ember serve --port 4200 指定端口时,它也有效。

我尝试过的一些事情:

  • 重新启动我的电脑。
  • 删除了 node_modules
  • 删除 ember tmp 目录。
  • 禁用了我的防火墙。
  • 尝试使用禁用的 Wi-Fi。

有什么想法吗?


我在 masOS High Sierra 10.13.6 上运行以下版本:

  • Node :8.11.3
  • ember-cli: 2.18.2
  • npm: 5.6.0 (也试过 6.3.0)

知道也很有用:

  • 我的计算机上运行着其他 ember 应用程序,一切正常。
  • 我最近才开始遇到这个问题。
  • 过去,macOS 会在打开应用程序时不断询问我是否授权传入流量,但现在它不再询问我了。

最佳答案

我遇到了这个问题,并追踪到在 .ember-cli 中对 port 使用字符串与整数。

// .ember-cli
{
  "port": 8080, // works
  "port": "8080", // throws the error mentioned above
}

不确定这是否是其他人出现此错误的原因。如前所述,首先要确保该端口上实际上没有其他任何东西在运行。但是 OP 已经检查过了,我也是。

关于node.js - Ember Server : "Port 4200 is already in use", 当没有进程在 4200 上运行时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51755399/

相关文章:

networking - 获取总延迟-UDP音频通信

mysql - nodejs 和 sql 查询 - 并发访问

node.js - 我收到以下错误 - NPM 错误 : debug module is not working

json - 浏览器缓存: Json response

java - 使用 Javapackager 自定义 .app 包的资源目录

html - CSS 位置 :fixed is not working?

javascript - 在 WebPack 中使用 babel 转译器时出现问题

oracle - 在 Mac OS X 上安装 ROracle - Oracle 需要什么?

c++ - 将 IP 地址添加到 NIC 的跨平台方式(使用 C++)

c - 如何查找已连接套接字使用的网络接口(interface)