AndrewBelt / hack.chat

a minimal, distraction-free chat application
https://hack.chat/
MIT License
2.39k stars 338 forks source link

Getting SyntaxError while node server.js #84

Open NoorQureshi opened 8 years ago

NoorQureshi commented 8 years ago

[root@server hack.chat-master]# node server.js SyntaxError: Unexpected token . in JSON at position 116 at Object.parse (native) at loadConfig (/root/hack/hack.chat-master/server.js:13:17) at Object. (/root/hack/hack.chat-master/server.js:22:1) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Function.Module.runMain (module.js:575:10) at startup (node.js:160:18) /root/hack/hack.chat-master/node_modules/ws/lib/WebSocketServer.js:39 throw new TypeError('port or a server must be provided'); ^

TypeError: port or a server must be provided at new WebSocketServer (/root/hack/hack.chat-master/node_modules/ws/lib/WebSocketServer.js:39:11) at Object. (/root/hack/hack.chat-master/server.js:28:14) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Function.Module.runMain (module.js:575:10) at startup (node.js:160:18) at node.js:456:3

AndrewBelt commented 8 years ago

Have you copied config-sample.json to config.json?

NoorQureshi commented 8 years ago

yup! http://i.imgur.com/s4JGyiy.png

AndrewBelt commented 8 years ago

The host value should either be 127.0.0.1 or 0.0.0.0 in almost all cases so why is it censored? And it doesn't look like you put quotes around the value.

NoorQureshi commented 8 years ago

thank you! Andrew for helping me out! it worked! and one more thing! if i close my ssh the service will be closed and i want it to be running if the ssh is closed!

And i wanna DNS srv properly for hack.chat to work in on my domain! and ssl as well!

thank you!

marzavec commented 8 years ago

@NoorQureshi in reference to the ssh issue; personally I prefer pm2 ( http://pm2.keymetrics.io/ ) for my Node services.

M4GNV5 commented 8 years ago

you mixed that up use [label](url) NOT [url](label) so heres a working link: keymetrics