Phoenix框架 - 在新建Socket时出现无效参数 - Windows

3

我无法运行新的Phoenix应用程序。这是我得到的错误信息;我不确定原因是什么。

我尝试更改端口,但没有改变行为。此外,似乎我能够正确运行节点。

Compiled web/views/error_view.ex
Compiled web/controllers/page_controller.ex
Compiled web/views/page_view.ex
Compiled web/views/layout_view.ex
Compiled lib/test_phoenix/endpoint.ex
Generated test_phoenix app
[info] Running TestPhoenix.Endpoint with Cowboy on port 4000 (http)

net.js:156
    this._handle.open(options.fd);
                 ^
Error: EINVAL, invalid argument
  at new Socket (net.js:156:18)
  at process.stdin (node.js:664:19)
  at bindWatcherEvents (c:\Desarrollo\Phoenix\test_phoenix\node_modules\brunch\l
ib\watch.js:597:12)
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:667:9
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:557:16
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:188:12
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\node_modules\async-e
ach\index.js:24:44
  at c:\******\Phoenix\test_phoenix\node_modules\brunch\lib\watch.js:175:14
  at Object.cb [as oncomplete] (fs.js:168:19)

似乎Brunch中的watch库在Windows上无法使用。在您的情况下,一切应该仍然正常,但资产不会自动编译(您需要手动运行“brunch build”)。 - José Valim
你也可以更改 brunch 的使用方式为轮询: https://github.com/brunch/brunch/blob/master/docs/config.md 你只需要在配置文件中添加 watcher: { usePolling: true } 即可。 - José Valim
@JoséValim 使用 watcher:{usePolling:true} 没有解决问题。:( 有其他建议吗? - Terence Chow
@JoséValim,这种类型的错误会影响我创建简单聊天应用程序的能力吗?除此之外,我似乎没有遇到任何错误,但是我的示例聊天应用程序无法工作...这个错误似乎影响了套接字,所以我想知道是否这是问题的原因... - Terence Chow
你需要能够编译你的资源。你可以使用 --no-brunch 启动 Phoenix 应用程序,它将使用另一种机制生成资源。这个 bug 的另一个可能来源是 Node.JS 版本。你使用的是哪个版本? - José Valim
1个回答

1

我遇到了类似的问题,根据Jose Valim的建议,我更新了Node到最新版本。这解决了问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接