NPM errors while installing react.js
[![enter image description here][1]][1]
[1]: https://i.sstatic.net/0fRAy.png**strong text**
NPM errors while installing react.js
[![enter image description here][1]][1]
[1]: https://i.sstatic.net/0fRAy.png**strong text**
Solution 1: Force to the latest version Just try to run the create command with force to the latest version. Just like this:
npx create-react-app@latest_version my-app --use-npm
And the latest version is 5.0.0 so just try this command:
npx [email protected] my-app
Now, your error must be solved.
Solution 2:
Clear the cache You just need to clear your cache and then you can create a new React project. First of all, clear the cache by running this command:
npx clear-npx-cache
If it does not work, use this and try again: Delete everything from this path.
C:\Users\Your_user_name\AppData\Roaming\npm-cache
On macOS (and Linux), it’s ~/.npm/_npx. You can drop it in your terminal:
rm -rf ~/.npm/_npx
Or try the command npm cache clean --force using administrator mode in your terminal. Now, just re-enter your create command.
npx create-react-app my-app