2

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)
amirudev
  • 63
  • 2
  • 6
  • Can you share which version of eslint-webpack-plugin are you using? – Bozhinovski Dec 19 '22 at 10:08
  • i was find out with npm list, and this returned related to eslint-webpack-plugin – amirudev Dec 19 '22 at 10:11
  • eslint-webpack-plugin@3.2.0 │ │ ├─┬ @types/eslint@8.4.10 │ │ │ ├── @types/estree@1.0.0 │ │ │ └── @types/json-schema@7.0.11 deduped │ │ ├─┬ jest-worker@28.1.3 │ │ │ ├── @types/node@18.11.17 deduped │ │ │ ├── merge-stream@2.0.0 deduped │ │ │ └─┬ supports-color@8.1.1 │ │ │ └── has-flag@4.0.0 deduped │ │ ├─┬ micromatch@4.0.5 │ │ │ ├─┬ braces@3.0.2 │ │ │ │ └─┬ fill-range@7.0.1 │ │ │ │ └─┬ to-regex-range@5.0.1 │ │ │ │ └── is-number@7.0.0 │ │ │ └── picomatch@2.3.1 │ │ ├── normalize-path@3.0.0 │ │ └─┬ schema-utils@4.0.0 │ │ ├── @types/json-schema@7.0.11 – amirudev Dec 19 '22 at 10:12
  • eslint-webpack-plugin@3.2.0 – amirudev Dec 19 '22 at 10:12

1 Answers1

1

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.)

pettys
  • 2,293
  • 26
  • 38