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
user@users-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?
Clear your npm cache first then use yarn as follows:
npm cache clean --force
npm cache verify
yarn create react-app my-app
I hope this helps.
I too had the same problem. When I trid the
npm init react-app my-app
command returned the same messageBut
yarn create react-app my-app
command works fine.After using this command:
I then tried:
This worked though:
This works for me!
1)
npm uninstall -g create-react-app
2)
npm install -g create-react-app
3)
npx create-react-app app_name
First uninstall create-react-app globally by this command:
then in your project directory:
finally:
I fix this issue on Mac by uninstalling
create-react-app
from global npm lib, that's basically what said, just try to do, you need also dosudo
:Then simply run:
Now should be all good and get the folder structures as below: