node.js SyntaxError: Invalid or unexpected token

后端 未结 2 1844
囚心锁ツ
囚心锁ツ 2021-01-19 22:13

I have downloaded and installed node.js from https://nodejs.org/en/. I want to run a js file:

console.log(\'hello\');

I run nod

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-19 22:31

    The problem was that I created the file by redirecting output from echo command in powershell. It had UTF-16 LE encoding, should be UTF-8

提交回复
热议问题