sbstjn / noduino

JavaScript and Node.js Framework for controlling Arduino with HTML and WebSockets
http://sbstjn.github.io/noduino/
1.23k stars 232 forks source link

Cannot read property 'port' of null #14

Open christaggart opened 11 years ago

christaggart commented 11 years ago

I've had no issue with socketio in the past, but running the example results in this. I haven't changed any of the settings in srv.app.js or anything else.

node srv.web.js info - socket.io started

timers.js:103 if (!process.listeners('uncaughtException').length) throw e; ^ TypeError: Cannot read property 'port' of null at /Users/me/Projects/noduino/srv.web.js:17:83 at Object.context.execCb (/Users/me/Projects/noduino/node_modules/requirejs/bin/r.js:1692:33) at Object.Module.check (/Users/me/Projects/noduino/node_modules/requirejs/bin/r.js:948:51) at Object.Module.enable (/Users/me/Projects/noduino/node_modules/requirejs/bin/r.js:1211:22) at Object.Module.init (/Users/me/Projects/noduino/node_modules/requirejs/bin/r.js:861:26) at Object.context.makeRequire.mixin.isBrowser as _onTimeout at Timer.list.ontimeout (timers.js:101:19)

glidej commented 11 years ago

Make sure you're not using port 8080 (used in srv.app.js) or 8090 (used in srv.socket.js) for something else. I ended up changing 8080 to 8081 and it worked for me.

karmakazi commented 10 years ago

I have this exact issue too. I have run it with default setting and I've changed the port still no dice.

karmakazi commented 10 years ago

I figured this one out. If I was running this on a server I wouldn't have had a issue but I'm running this on my laptop... and.... as it turns out I have a lot of ports open. I think anybody running this on OSX on their personal computer will likely have port conflicts. I would advise creating some kind of config file that makes changing this easier.

Here how to fix the problem: 1) Run the following command to see a list of ports in use: netstat -anf inet

2) Open the file srv.app.js 3) Change the port in the following line to one that is open: var kickstart = kickstart.withConfig({'name': 'localhost', 'port': 9000, 'path': './'});