L
L
lazuren2015-07-03 11:28:02
Node.js
lazuren, 2015-07-03 11:28:02

The file in (node.js) does not start, what could be the problem?

I have a Mac OS and the problem is that after installing node.js I cannot run .js files in the terminal.
It works like this
> console.log('hello')
hello
undefined
But it doesn't work like this
> node hello.js
SyntaxError: Unexpected identifier
at Object.exports.createScript (vm.js:44:10)
at REPLServer.defaultEval (repl.js: 117:23)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer. (repl.js:279:12)
at REPLServer.emit (events.js:107:17)
at REPLServer.Interface._onLine (readline.js:214:10)
at REPLServer.Interface._line (readline.js:553: eight)
at REPLServer.Interface._ttyWrite (readline.js:830:14)
at ReadStream.onkeypress (readline.js:109:10)
>
What's the problem ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pesenka1, 2015-07-03
@lazuren

1.Exit REPL (.exit or ctrl+c)
2.node path/to/your/file
3.RTFM

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question