poisontap icon indicating copy to clipboard operation
poisontap copied to clipboard

SyntaxError when running backend_server.js in Node

Open JonathanNathanson opened this issue 7 years ago • 7 comments

Hi,

I'm getting a bunch of SyntaxErrors thrown by NodeJS when trying to run the backend_server.js on my server. I've tried the repo I pulled yesterday, and then re-cloned the latest version via Git just to make double-sure..

|- /home/jono jono@ubuntu:~$ git clone https://github.com/samyk/poisontap.git Cloning into 'poisontap'... remote: Counting objects: 370, done. remote: Compressing objects: 100% (83/83), done. remote: Total 370 (delta 295), reused 360 (delta 285), pack-reused 0 Receiving objects: 100% (370/370), 4.34 MiB | 2.91 MiB/s, done. Resolving deltas: 100% (295/295), done. Checking connectivity... done.

Trying to launch throws this error:

nodejs backend_server.js

/home/jono/poisontap/backend_server.js:9 var server = http.createServer((request, response) => { ^

SyntaxError: Unexpected token > at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3

It's not displaying particularly well in this Markdown codeblock but I think you get the gist. It's not liking the =>.

Anyone else having this issue? Admittedly node isn't something I've used in anger so this could be a fairly daft question...

JonathanNathanson avatar Nov 19 '16 13:11 JonathanNathanson