I ran in to an unusual error recently when I tried to run create-react-app. I’d recieve Template Not Provided Using Create React App. Let’s explore what this error is and how we can fix it.
I went to create a new React project using create-react-app recently, and something very strange happened. The process finished, but the project was empty, all bar a package.json file.
I checked the response in my Terminal window, and lo and behold, create-react-app didn’t complete properly. Instead, I had the following 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 27.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.
The Fix
The issue lies in having installed create-react-app globally before with NPM. Therefore, we have to completely uninstall the package from our system.
1) Uninstall Create-React-App Globally
npm uninstall -g create-react-app
Check that create-react-app has indeed been uninstalled completly by running the following command in your Terminal window:
which create-react-app
If this returns with a directory location, such as /usr/local/bin/create-react-app, then run the following command to delete the directory entirely.
rm -rf /usr/local/bin/create-react-app
2) Run NPX Create-React-App Again
Now, give it another try! This time it should work:
npx create-react-app new-project
If this fixed the template not provided using create react app issue for you, fantastic! If not, leave a comment below with a sample of the terminal output and I’ll reply with a solution.
To learn more about React, why not check out my beginner tutorial on how to create your first app in React?
💬 Leave a comment