3

I'm trying to get a simple node.js example working on nitrous.io. I've pretty much just followed the yeoman tutorial with the angular template. I've had to modify my localhost to 0.0.0.0 and change my liveReload port to 4000. I also had to run grunt server with a --force command because I get the following error:

Warning: Command failed: /home/action/workspace/node-test/node_modules/grunt-open/node_modules/open/vendor/xdg-open: 1: /home/action/workspace/node-test/node_modules/grunt-open/node_modules/open/vendor/xdg-open: xdg-mime: not found   

After jumping through these hurdles live reload doesn't seem to work. Does my "box" need to have xdg-mime or xdg-utils installed for this to work? The file watcher appears to notice the change but the webpage does not update after any of the js polling.

(I'm new to all of these technologies, but it seems like this tutorial example should work)

Edit: After help from Sindre I no longer have the, now obviously simple (hindsight), issue with missing xdg-mime but I do have an issue with live reload not working

Community
  • 1
  • 1
David Kassa
  • 764
  • 7
  • 14

4 Answers4

6

Per Nitrous.io support

The issue here is that websockets is blocked on Nitrous servers, which only HTTP ports 3000 - 9000 are open at this time. Live reload needs to run HTTP and WebSockets on the same port in order to function.

WebSocket support may be something we will be adding in the near future

David Kassa
  • 764
  • 7
  • 14
  • 2
    Update: Nitrous.IO now supports WebSockets ( http://help.nitrous.io/websockets/ ). HTTP posts 1024 - 10,000 are now open as well. – Greg Apr 28 '14 at 19:31
1

It needs XDG, which is installed by default on most systems, to be able to open it up in the browser.

Sindre Sorhus
  • 62,972
  • 39
  • 168
  • 232
  • Can you clarify? Nitrous.io is a hosted IDE so I don't need any auto-action to launch my browser. I am performing "remote" dev in this case. – David Kassa Sep 02 '13 at 23:02
  • 1
    Then you don't need the `open` task, so just remove it. – Sindre Sorhus Sep 03 '13 at 00:58
  • that helped the error go away, but not my root issue of live reload not working. – David Kassa Sep 03 '13 at 13:22
  • LiveReload needs to run WebSockets and HTTP on the same port. Nitrous does not have WebSockets opened at all as of 9/3/2013, so you may need to wait for future support of this. – Greg Sep 03 '13 at 19:48
0

As you have discovered, LiveReload requires WebSockets, which Nitrous does not support out of the box. However, there is good news: you can get them to work by forwarding through an SSH tunnel. I have written up more detailed instructions on Coderwall.

X1011
  • 25
  • 6
0

I needed to install xdg-utils to fix this:

Running "open:server" (open) task
finished populating things
Warning: Command failed: /generator-test/node_modules/grunt-open/node_modules/open/vendor/xdg-open: line 584: xdg-mime: command not found
xdg-open  no method available for opening 'http://localhost:9000'
 Use --force to continue.

./xdg-open: line 584: xdg-mime: command not found
xdg-open  no method available for opening 'http://www.google.com'

node_modules/open/vendor/ contained xdg-open, but not xdg-mime.

The remote server I am using did not have have xdg-utils installed... not sure why xdg-mime was missing from the node_modules dir...

steve98177
  • 2,121
  • 2
  • 14
  • 6