While doing some tutorials using react, I ran into an unusual error when creating a new react application using create-react-app command.
So today, I'll show you how to fix this kind of error which you might encounter later on while developing your react application.
Error:
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
..... nothing out of the ordinary here .....
✨ Done in 19.28s.
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
Solution:
In our system verified the exact location of our create-react-app command by typing this code.
which create-react-app
In case it returned a path, commonly in this location
/usr/local/bin/create-react-app
Now, we know the exact location we can used it later on to remove all the existing file after we uninstall this command.
Uninstall Create-react-app in our system.
npm uninstall -g create-react-app
Remove the file path, from step 2.
sudo rm -rf /usr/local/bin/create-react-app
Finally, use either one of the below commands:
npx create-react-app lcp-app // or npm init react-app lcp-app // or yarn create react-app lcp-app
Voila
It should be like this after you run the npx create-react-app lcp-app
or any of the command in step 4.
Next Tutorial
Learn how to setup your first react application. In a few minutes. Beginners Guide to React Application
Voila!!!
I hope you enjoy our tutorial, Let me know incase you encounter any error I would love to answer that. Don't forget to subscribe to my Youtube Channel at Let's Code Pare - Youtube Channel
