npx create-react-app my-app
doesn't work for me
i tried npm cache clean --force
but i get the same error again and again
npm cache clean --force
npx create-react-app front
npm init react-app front
npx: installed 98 in 37.068s
Creating a new React app in /home/h4kst3r/Desktop/APIs/restaurant-API/front.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '...zAJNgZjZUkJ08ybAxwNnR'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/h4kst3r/.npm/_logs/2020-05-20T20_47_49_189Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting front/ from /home/h4kst3r/Desktop/APIs/restaurant-API
Done.
OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
You can solve the "Unexpected end of JSON input" error in the following 3 ways: wrap your parsing logic in a try/catch block. make sure to return a valid JSON response from your server. remove the parsing logic from your code if you are expecting an empty server response.
Its happened because of slow internet . So wait till ur internet connection is normal. Or install all dependencies one by one .
If npx create-react-app my-app
command not working and throws an error like: npm ERR! Unexpected end of JSON input while parsing near '...zAJNgZjZUkJ08ybAxwNnR'
, Just check your npm version:
npm --version
npm -v
and if required update it:
npm install -g npm@latest
It will definitely work.
First check for npm version
by running the following command npm --version
. if you have an npm version then try instally npx
globally with the help of npm i -g npx
. if npm
and ngx
are installed properlly then this will work .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With