3
votes

I'm not able to run a new phoenix app. This is the error I'm getting; I'm not sure what the reason could be.

I tried changing the port, which didn't change the behaviour. Also, it seems like I'm able to run node correctly.

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)
1
It seems that the watch library in brunch does not work on Windows. Everything should still work in your case, assets won't be automatically compiled though (you need to run brunch build manually for now). - José Valim
You can also change brunch to use polling: github.com/brunch/brunch/blob/master/docs/config.md You should be able to add watcher: { usePolling: true } to your configuration. - José Valim
@JoséValim using watcher:{usePolling:true} did not fix. :( any other suggestions? - Terence Chow
@JoséValim would this type of error affect my ability to create the simple chat app? Seems like I'm not getting any errors besides this and my chat app from the examples is not working...This error seems to be affecting sockets so i'm wondering if that's the issue... - Terence Chow
You need to be able to compile your assets. You can start a Phoenix app with --no-brunch and it will generate assets using another mechanism. Another possible source of this bug is the Node.JS version. Which one do you have? - José Valim

1 Answers

1
votes

I was just running into a similar problem and I updated Node to the latest version as Jose Valim suggested. That fixed the problem.