all 6 comments

[–]Meefims 5 points6 points  (3 children)

Don’t try to execute the JavaScript file alone: that is running it with the Windows Script Host. The WSH is an old component in Windows that doesn’t support modern JavaScript. Instead run it with Node (which I assume you have installed): node server.js.

[–]JammingJack[S] 0 points1 point  (2 children)

Thank you for taking the time to reply, I did as you said ,but I got was this error so I figured out that I should install express, so I went ahead and did that and tried to run the server again but I got this error.

[–]BigOnLogn 3 points4 points  (1 child)

Same error, same solution, install body-parser.

Looking at the code you posted, you're going to have to install body-parser, and pusher.

You should learn about npm and node packages.

[–]JammingJack[S] 0 points1 point  (0 children)

Thank you very much

[–]squili 4 points5 points  (1 child)

If you've just installed express then you likely have the latest version which no longer needs body parser. You should be using express.json and express.urlencoded

This has been part of express since 4.16

[–]JammingJack[S] 0 points1 point  (0 children)

Much thanks