Why do I get: "Uncaught SyntaxError: Unexpected identifier in Nodejs"?

Hi everybody. I have an issue with NodeJS. When type node game.js I get the following error:

node game.js
node game.js
^^^^

Uncaught SyntaxError: Unexpected identifier

When I try to open that javascript file in NodeJS in the PowerShell Terminal(Like I always to do…it used to work before) I am running this file inside in nodejs while I am in the same folder the file is located. I have used ESLint and run the code on Eprima online validator and the code has no errors. I have Node Node.js LTS v18.16.0 installed. It would be great if somebody can help me to fix this issue.

The issue is not the code. I run the code in Chrome with Live Server and it’s working. The problem is with NodeJS or PowerShell terminal.

I tried uninstalling NodeJS and installing again, but that didn’t solve the problem.

Thank you in advance!
Cheers
Junier

image

unfortunately if I don’t resolve this issue I cannot follow the course I bought from Mosh: NodeJS and Javascript that I bought on Uddemy.