How To Solve Template not provided using create-react-app

Share This Post

Are You Facing Template not provided using create-react-app Error ? Here We Are Providing All Possible Solution for Template not provided using create-react-app.

Solution 1

If you’ve previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.

Use either one of the below commands:

  • npx create-react-app my-app
  • npm init react-app my-app
  • yarn create react-app my-app

Solution 2

1)

npm uninstall -g create-react-app

or

yarn global remove create-react-app

2) There seems to be a bug where create-react-app isn’t properly uninstalled and using one of the new commands lead to:

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

After uninstalling it with npm uninstall -g create-react-app, check whether you still have it “installed” with which create-react-app on your command line. If it returns something (e.g. /usr/local/bin/create-react-app), then do a rm -rf /usr/local/bin/create-react-app to delete manually.

3) Then one of these ways:

npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app

Solution 3

Here I came up with 3 solutions which I applied step by step when I faced this situation.


First step: From Official manual,

If you’ve previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version.

You can use these commands below:

  • npx create-react-app my-app
  • npm init react-app my-app
  • yarn create react-app my-app

Second step (If first one doesn’t work):

Sometimes it may keep caches.then you can use these commands given below.

  • npm uninstall -g create-react-app
  • npm cache clean --force
  • npm cache verify
  • yarn create react-app my-app

Third step:(If these 2 won’t work) first uninstall via npm uninstall -g create-react-app,then check if you still have it “installed” with which create-react-app command on your command line. If you got something like (/usr/local/bin/create-react-app) then run this rm -rf /usr/local/bin/create-react-app (folder may vary) to delete manually. Then again install it via npx/npm/yarn.

NB: I succeed in the last step.

Solution 4

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 GloballyTerminal

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.

Leave a Reply

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

close