snippetreactCritical
Template not provided using create-react-app
Viewed 0 times
createprovidedapptemplatereactusingnot
Problem
When I type the
Input
Output
In package.json of
I checked out the CRA changelog and it looks like support was added for custom templates - however it doesn't look like the command
Any idea what is going on here?
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
user@users-MacBook-Pro-2 Desktop% create-react-app my-appOutput
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?
Solution
If you've previously installed
Docs
Use either one of the below commands:
if
Type
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
if
npm uninstall -g create-react-app stated above does not work.Type
which create-react-app to know where it is installed. Mine was installed in /usr/bin folder. Then do sudo rm -rf /usr/bin/create-react-app. (Credit to @v42 comment below)Context
Stack Overflow Q#59188624, score: 566
Revisions (0)
No revisions yet.