Skip to content Skip to sidebar Skip to footer

Node Repl Throws Syntaxerror: Unexpected Identifier

I am very newbie to node.js. In the node REPL everything was working fine. But something changed. When I try to execute a file it shows this... D:\Projects-2015\uniqueva>node /&

Solution 1:

You can't call the node executable from within the node REPL... Only JavaScript statements/expressions.

Try require('./module.js')

Solution 2:

Are you running node by double clicking on it?

You have to run node from command line and give command node xyz.js on command line.

node should be in your class path or while executing node use full path. such as c:\work\nodetest\node .\xyz.js

in above i coped the js file in same folder as node file.

Post a Comment for "Node Repl Throws Syntaxerror: Unexpected Identifier"