0

I install node and create-react-app on my fresh ubuntu system. But got this error.

Error

Unexpected end of JSON input while parsing near '...","shasum":"48db9f033' enter image description here

I uninstall node and create-react-app globally, then install it again. Still got the same error.

Tried

Below commands, I tried to resolve this issue but nothing could be worked

npm cache clean --force

npm config set registry "https://registry.npmjs.com/"

info

I could not found this error log file in .npm/_logs. Because there is no file in this directory

enter image description here

npm -v 6.14.8

node -v 10.19.0

create-react-app --version 3.4.1

Mukkaram Waheed
  • 483
  • 7
  • 31

2 Answers2

0

Delete your package-lock.json file and have a try again.

Eric
  • 1,279
  • 1
  • 11
  • 8
  • I run this command **sudo rm -rf node_modules package-lock.json** but still got the same error. In which directory run this command? – Mukkaram Waheed Sep 17 '20 at 19:46
  • In the root folder of your project, run rm package-lock.json, then npm cache clean --force and npm install – Eric Sep 17 '20 at 19:53
  • cannot remove 'package-lock.json': No such file or directory. **pwd /home/abd**. I run this command in this directory. I open the terminal using ctrl+shft+t then run this command – Mukkaram Waheed Sep 17 '20 at 19:59
-1

Try either running without sudo on a directory your user owns, or using sudo su beforehand so that you're already logged as supe user before running create-react-app

Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206