nobot-examples
nobot-examples copied to clipboard
a.js unexpected token
Hi Shaun I am not an expert in node, I created a.js and b.js, when I run a.js I get (The ^ character is under the 2 parentheses ())
\Automating with Node.js\node a.js
\Automating with Node.js\b.js:1
rts, require, module, __filename, __dirname ) { const arsenalFanChant = () => {
^
SyntaxError: Unexpected token )
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (E:\Salam\Dev\Html\Automating with Node.js\a.js:1:73)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Hey! What node version are you running?
4.4.5 is the minimum version for using the arrow function it's complaining about 😁
Hi, When I run node -v I get v0.12.2 Regards
Ahh yes, that is the problem. You will need to update your node version that is quite old 👍 Book requires a newer version of Node to proceed. Hope that helps!
Ok, I upgraded and it is running fine, continued on next and created a file with the functions for GetPizza but not sure how to run this in the command line, thanks for your help