wit-ai / node-wit

Node.js SDK for Wit.ai
Other
2.05k stars 485 forks source link

Syntax error in messenger.js Or something I'm doing wrong? #19

Closed mrizwan47 closed 8 years ago

mrizwan47 commented 8 years ago

I went through quickstart guide, but I am stuck at when running node examples/messenger.js. It gives me this error:

/home/rizwan/chatbot/examples/messenger.js:16 const bodyParser = require('body-parser'); ^^^^^ SyntaxError: Use of const in strict mode. 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

Let me know if there's something I'm missing?

willianjusten commented 8 years ago

Put use strict to the top of the file.

patapizza commented 8 years ago

use strict; is already present in examples/messenger.js.

As mentioned in the quickstart:

Run your script (if it complains about strict mode, update Node.js)

What version of Node.js are you using?

mrizwan47 commented 8 years ago

Yes, it was out dated version issue. Fixed by updating, thanks.