Node REPL throws SyntaxError: Unexpected identifier

前端 未结 2 867
感动是毒
感动是毒 2021-01-20 02:57

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-         


        
2条回答
  •  醉梦人生
    2021-01-20 03:05

    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.

提交回复
热议问题