Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React JS npm run start return error SyntaxError: Unexpected token;

I was trying to start react web server with npm start but accidentally it returning

/home/azureuser/react-inventory/node_modules/eslint-webpack-plugin/node_modules/jest-worker/build/index.js:110
  _ending;
         ^

SyntaxError: Unexpected token ;

I thought that this wasn't my fault as it worked fine on my local machine but error on virtual machine is this dependencies problem of eslint-webpack-plugin and I need to submit issue there or this happened because of my machine ?

My Virtual Machine : Microsoft Azure Ubuntu 20.04 LTS Node Version v10.19.0

Full error message produced /home/azureuser/react-inventory/n

ode_modules/eslint-webpack-plugin/node_modules/jest-worker/build/index.js:110
  _ending;
         ^

SyntaxError: Unexpected token ;
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/azureuser/react-inventory/node_modules/eslint-webpack-plugin/dist/getESLint.js:9:5)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
like image 851
amirudev Avatar asked Mar 08 '26 13:03

amirudev


1 Answers

This problem occurs on older versions of nodejs, like your v10, but not newer versions, like v18. Try upgrading nodejs.

Similar question and answer: Azure pipeline npm build failing for React: Unexpected token (This question is dealing with Azure Pipelines, but the root problem is the same and proposed solution applies.)

like image 106
pettys Avatar answered Mar 10 '26 02:03

pettys



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!