1

I am trying to add firebase to my react app.But when I type npm install firebase I get strange error like: Unexpected end of JSON input while parsing near 'Error message '. Error message is different every time i run npm install firebase.I have looked this questions:

  1. Firebase npm install error
  2. Unable to do "npm install --save firebase"
  3. Firebase - Failing to install firebase using npm but yarn works I have tried npm cache clean --force,and after npm update ,but that didn't work.Also I have tried downgrading npm,but that either did not work.Also I have tried uninstalling node,and installing again ,but that did not help either.Thanks in advance

npm version 6.13.7


node version v12.19.0

Zivojin Milutinovic
  • 1,000
  • 7
  • 16

2 Answers2

2

How about just to be sure remove package-lock.json and delete node_modules folder with rm -rf node_modules?

And after that npm install again.

Good luck.

Kevin Moe Myint Myat
  • 1,916
  • 1
  • 10
  • 19
0

It looks like npm cache was corrupted ,but as npm cache clean --force did not work,deleting _cacache directory in C:\Users\User\AppData\Roaming\npm-cache solved my problem.After that npm install worked just fine.

Zivojin Milutinovic
  • 1,000
  • 7
  • 16