我想從node.js開始。只是在一個HelloWorld.js文件中寫道Node.js中的Hello world
console.log("Hello World");
,並試圖運行在終端上
節點HelloWorld.js。我看到以下錯誤:
/Users/arkidmitra/Desktop/NodeJs/helloworld.js:1
��c
^
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:399:25)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array.<anonymous> (module.js:423:10)
at EventEmitter._tickCallback (node.js:126:26)
我在簡單的textedit中寫道它。我可以在文件中看到一些特殊字符。什麼是可能的問題,我該如何解決它?
用vi試過。還沒有工作 – Arc 2011-04-24 16:06:23
刪除原始文件,並重寫它。 – Kayla 2011-04-24 16:08:02
在vi中刪除並重寫。工作。謝謝 – Arc 2011-04-24 16:11:26