title: Error installing reactjs: Error unexpected end of JSON input while parsing near
body: <p>I tried installing reactjs via node using two different commands in the terminal using 1) <code>npx create-react-app my-app</code> and 2) <code>npx create-react-app app</code></p>
  
  <p>But both yielded the same error shown below:</p>
  
  <blockquote>
    <p>Installing packages. This might take a couple of minutes.</p>
    
    <p>Installing react, react-dom, and react-scripts with cra-template...</p>
    
    <p>npm ERR! Unexpected end of JSON input while parsing near
    '....1","object-hash":"^1'</p>
    
    <p>npm ERR! A complete log of this run can be found in:</p>
    
    <p>npm ERR!
    C:\Users\David\AppData\Roaming\npm-cache_logs\2020-02-12T03_53_37_836Z-debug.log</p>
    
    <p>Aborting installation.</p>
    
    <p>npm install --save --save-exact --loglevel error react react-dom
    react-scripts cra-template has failed.</p>
  </blockquote>
  
  <p>I tried uninstalling and reinstalling node and also trying to install different older versions of reactjs but still got the same error. Also, I have tried clearing the node cache and then verifying it again via <code>npm cache clear --force</code> and then <code>npm cache verify</code> but still have not had any luck. Any help will be greatly appreciated.</p>
  
  <p>The more detailed log shows this at the bottom:</p>
  
  <blockquote>
    <p>203 silly saveTree `-- react@16.12.0</p>
    
    <p>204 verbose stack SyntaxError: Unexpected end of JSON input while
    parsing near '....1","object-hash":"^1'</p>
    
    <p>204 verbose stack at JSON.parse ()</p>
    
    <p>204 verbose stack at parseJson (C:\Program
    Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)</p>
    
    <p>204 verbose stack at C:\Program
    Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50</p>
    
    <p>204 verbose stack at processTicksAndRejections
    (internal/process/task_queues.js:97:5)</p>
    
    <p>205 verbose cwd C:\Users\David\Desktop\React\my-app</p>
    
    <p>206 verbose Windows_NT 10.0.17763</p>
    
    <p>207 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program
    Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--save"
    "--save-exact" "--loglevel" "error" "react" "react-dom"
    "react-scripts" "cra-template"</p>
    
    <p>208 verbose node v13.8.0</p>
    
    <p>209 verbose npm v6.13.6</p>
    
    <p>210 error Unexpected end of JSON input while parsing near
    '....1","object-hash":"^1'</p>
    
    <p>211 verbose exit [ 1, true ]</p>
  </blockquote>