Vito Medlej
Vito Medlej

Reputation: 171

Create React App throws error while starting server

This error shows up whenever I run npm start.

I've tried npm install. I have no errors in the console.

Also I'm not using JSON.parse in any of my files.

Full error:

Starting the development server...

C:\Users\user\Documents\GitHub\repo\client\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.getBuildInfo (C:\Users\user\Documents\GitHub\repo\client\node_modules\typescript\lib\typescript.js:107937:21)
    at readBuilderProgram (C:\Users\user\Documents\GitHub\repo\client\node_modules\typescript\lib\typescript.js:120294:28)
    at Object.createWatchProgram (C:\Users\user\Documents\GitHub\repo\client\node_modules\typescript\lib\typescript.js:120448:26)
    at Object.<anonymous> (C:\Users\user\Documents\GitHub\repo\client\node_modules\fork-ts-checker-webpack-plugin\lib\typescript-reporter\reporter\TypeScriptReporter.js:304:59)
    at Generator.next (<anonymous>)
    at C:\Users\Vito\Documents\GitHub\repo\client\node_modules\fork-ts-checker-webpack-plugin\lib\typescript-reporter\reporter\TypeScriptReporter.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Vito\Documents\GitHub\repo\client\node_modules\fork-ts-checker-webpack-plugin\lib\typescript-reporter\reporter\TypeScriptReporter.js:4:12)
    at Object.getIssues (C:\Users\user\Documents\GitHub\repo\client\node_modules\fork-ts-checker-webpack-plugin\lib\typescript-reporter\reporter\TypeScriptReporter.js:227:28)

Upvotes: 0

Views: 2416

Answers (2)

Vara Chaitanya
Vara Chaitanya

Reputation: 1

This error is because of the node modules. firstly delete the node modules folder

1.Delete node_modules folder.

2.open terminal and run ---> npm i

3.above command will install all the node modules again.

Upvotes: 0

GMKHussain
GMKHussain

Reputation: 4691

Try this steps

  1. remove node_modules

  2. intall again node packages npm i

Upvotes: 2

Related Questions