I tried installing a package in my react app using npm, and for some reason It fails: it shows the following error:
npm ERR! Object for dependency "@babel/generator" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".
I tried npm install to regenerate the package-lock.json but it's the same as before.
TLDR
Answer
First of all, How about clear
node_modulesandpackage-lock.jsonand retry install with
npm installornpm iand what I want to say is clear
package-lock.jsonandnode_modules. If you'd like to get more information about deleting here is the link