Sign Up

Sign In

Forget Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask question.

Template not provided using create-react-app

  • 0

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

Input

[email protected]-MacBook-Pro-2 Desktop% 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.

In package.json of my-app:

"dependencies": {
  "react": "^16.12.0",
  "react-dom": "^16.12.0",
  "react-scripts": "3.3.0" <-- up-to-date
}

I checked out the CRA changelog and it looks like support was added for custom templates – however it doesn’t look like the command create-react-app my-app would have changed.

Any idea what is going on here?

Click to rate this post!
[Total: 0 Average: 0]
Share This Post
Share
  1. This answer was edited.

    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
    • 3
  2. 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.

    Docs

    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
    • 0
Leave an answer

Leave an answer

Browse

close