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?

👋 Hey, I'm James Dietrich
I work full-time at an AI-based startup out of San Francisco, CA. My true passion is to help others. My tutorials help 150,000+ developers learn React and JavaScript every month. Follow on Twitter, or Github.

💬 Leave a comment

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

We will never share your email with anyone else.

Comments

Doing exactly as you indicated did not fix my issue. I got the same exact “template was not provided … ” message

I have tried several methods to fix the missing template issue and have not been successful. when I perform “which create-react-app” it gives a paragraph worth of file paths in multiple drives. example of one of the paths would be to my java jre files and other unrelated files paths. any help would be much appreciated.