Home > OS >  Node.js returning Syntax error: Unexpected identifier
Node.js returning Syntax error: Unexpected identifier

Time:02-05

I installed Node.js 19.6.0. Now, if I open the Node.js window and type in "git clone https://github.com/openai/openai-quickstart-node.git" to download the repository i get the error Unexpected identifier 'clone'. I am completely new to Node.js and dont understand the reason. Could you help me out?

git clone https://github.com/openai/openai-quickstart-node.git ^^^^^

Uncaught SyntaxError: Unexpected identifier 'clone'

enter image description here

best regards Robert

Opende Node.js and tried to trigger a command

CodePudding user response:

Your mistake here is that you're trying to use git clone inside of the Node.js interpreter, which is something different than the command line. To clone a repository, you'll need to use the command line on your machine with Git installed.

  • Related