How to fix template not provided using create-react-app in react error

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:

Terminal
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

Terminal
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:

Terminal
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.

Terminal
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:

Terminal
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?


📬 The Monthly Upmostly Newsletter

One email a month, packed with the latest React tutorials, delivered straight to your inbox.
Zero spam, just great content. Unsubscribe at any time.
James King headshot
👋 Hey, I'm James King
My tutorials help 60,000+ developers learn React and JavaScript every month. If you'd like to receive a friendly email once in a while of all new React tutorials, just pop your email above! I appreciate the support!

💬 Leave a comment

Your email address will not be published. Required fields are marked *

We will never share your email with anyone else.