Reputation: 1700
I am trying to start off with node.js. Just wrote
console.log("Hello World");
in a HelloWorld.js file and tried to run
node HelloWorld.js on the terminal. I see the following error:
/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)
I wrote it in simple textedit. I can see some special characters in the file. What is the possible problem and how do I resolve it?
Upvotes: 2
Views: 901
Reputation: 6949
I'd try using a different editor.
I quite like Kod, even though it's a bit buggy.
If you want something more stable, Komodo Edit should be good.
Also, you should delete and rewrite (not copy and paste) the file, to get rid of the unwanted characters.
Upvotes: 2