Search code examples
javascriptnode.jsnpmnode-modulesnodejs-server

I get the following Error in Node.js `Uncaught SyntaxError: Invalid or unexpected token`


C:\Users\User 1\Desktop\nlp_samurai\nlp_samurai\>npm install --save

If I run this command in Node.js Terminal I get the following Error Uncaught SyntaxError: Invalid or unexpected token..I need to run this command to install all the required Node.js modules for a project from github..Check the project In this link for better understanding


Solution

  • The issue you have is trying to call the command npm install --save with the directory name in it, instead of running the command from the directory.

    The command mentioned on the project's page is meant to install the projects dependencies. It has to be run in the directory nlp_samurai\nlp_samurai\. The easiest way to get there is to call cd [directory name] (Change Directory) and then run npm install --save.

    You can check out this tutorial to learn more about navigation in the Windows command line.