I have encountered this scenario a few times during installation of create-react-app or when installing react dependencies. There are various solution for this kind of problem. I am listing all of them below in three different stages, try them out accordingly : -
-
First Stage
- npm config set registry http://registry.npmjs.org/ --global
- npm cache clear --force
- Delete your package-lock.json file(it will automatically get created after npm i).
- Now try for npm install
-
Second Stage
- In your project directory type
- npm init
- npm update
- Restart your IDE
- Try installing dependency again
-
Third Stage
- Unistall node and npm
- Reinstall node again
These solutions worked for me, and I hope it works for you as well!.
Top comments (0)