[Solved] A template was not provided. This is likely because you're using an outdated version of create-react-app.

Article Tarif Hossain

When you type the "create-react-app my-app" command in your terminal, it appears to work - downloading all libraries successfully, etc. At the end of that process, however,  you may get a message that a template was not provided -

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.


Solution :

New versions of create-react-app does not support global install. You have to remove it globally. We recommend you to uninstall the package using this command to ensure that npx always uses the latest version -

npm uninstall -g create-react-app 

Now you can install new app using npx. Use this command:

npx create-react-app my-app


Special case 1:

If your system has any projects using CRA in the parent directory npm will pick up that version. Try it:

npx --ignore-existing create-react-app my-app. 

This will ignore any installs we have in our system.


Special case 2:

if "npm uninstall -g create-react-app" stated above does not work. Type this command to know where it is installed.

create-react-app

Generally it installed in /usr/bin folder. Then do remove it using - 

sudo rm -rf /usr/bin/create-react-app

Then install again the app using npx. If you face any problem please don't hesitate to comment below.