Node REPL throws SyntaxError: Unexpected identifier

前端 未结 2 963
感动是毒
感动是毒 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:30

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

    Try require('./module.js')

提交回复
热议问题