by Sai gowtham

How to solve the template not provided in Create-react-app

In this tutorial, we are going the learn about how to solve the template not provided error in create-react-app cli.

If you try to create a new react project using the create-react-app global cli you will see the following error in your terminal.

$ create-react-app my-app

Output:

Creating a new React app in /Users/user/Desktop/my-app.

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.

To fix this error follow the below steps:

  1. First, uninstall the global version of create-react-app package by using the below command.
npm uninstall -g create-react-app
  1. Run the following command to delete the create-react-app directory manually.
rm -rf /usr/local/bin/create-react-app
  1. Now, you can use the npx create-react-app command to create a new react project.

Here is an example:

npx create-react-app my-app

my-app is the folder name

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
130,921 students enrolled
48.5 hours of video content
View Course