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?

Avatar photo
👋 Hey, I'm James Dietrich
James Dietrich is an experienced web developer, educator, and founder of Upmostly.com, a platform offering JavaScript-focused web development tutorials. He's passionate about teaching and inspiring developers, with tutorials covering both frontend and backend development. In his free time, James contributes to the open-source community and champions collaboration for the growth of the web development ecosystem.

💬 Leave a comment

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

We will never share your email with anyone else.