hack.chat icon indicating copy to clipboard operation
hack.chat copied to clipboard

Getting SyntaxError while node server.js

Open NoorQureshi opened this issue 9 years ago • 6 comments

[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

NoorQureshi avatar Jun 16 '16 18:06 NoorQureshi

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

AndrewBelt avatar Jun 18 '16 07:06 AndrewBelt

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

NoorQureshi avatar Jun 24 '16 09:06 NoorQureshi

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.

AndrewBelt avatar Jun 24 '16 18:06 AndrewBelt

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!

NoorQureshi avatar Jun 24 '16 19:06 NoorQureshi

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

marzavec avatar Jun 24 '16 21:06 marzavec

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

M4GNV5 avatar Jun 24 '16 21:06 M4GNV5