Jestem nowy dla node.js Właśnie skończyłem instalowanie go na moim komputerze z systemem Windows. Aktualnie podążam za tutorialem na temat tutorialspoint. Po instalacji powiedziano mi, aby utworzyć plik main.js i umieścić następujący kod w pliku.Błąd Node.js dla przykładu Hello World
/* Hello, World! program in node.js */
console.log("Hello, World!")
Wykonałem plik main.js przy pomocy interpretera Node.js wpisując $ node main.js, ale wystąpiły następujące błędy.
SyntaxError: Unexpected identifierat Object.exports.createScript
(vm.js:24:10)
at REPLServer.defaultEval (repl.js:221:25)
at bound (domain.js:280:14)
at REPLServer.runBound [as eval] (domain.js:293:12)
at REPLServer.<anonymous> (repl.js:412:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
at REPLServer.Interface._ttyWrite (readline.js:826:14)
Proszę mi pomóc. Dziękuję Ci.
Myślę, że uruchamiasz 'węzeł main.js' nie z powłoki, ale z węzła REPL) –
Możliwy duplikat [Węzły wyrzuca REPL SyntaxError: nieoczekiwany identyfikator] (http://stackoverflow.com/questions/29227486/node-repl-throws-syntaxerror-nieoczekiwany-identyfikator) –