I am trying to create a new project using create-react-app
using the command given on the docs i.e npx create-react-app my-app
but it doesn't contain folders like public
src
and script
.
Try with these steps :
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
-
For more options can also go to github.com/facebook/create-react-app/issues/8088 – Ankit Sinha Dec 10 '19 at 7:26
For those who keep trying and still doesn't work, you might have the same problem as me.
Because the global installs of create-react-app are no longer supported you might have it installed on your machine, thus have the old version running whenever you try to npx create-react-app. There are 2 very easy steps: remove create-react-app, then run the npx command.
It will look like this:
- sudo npm rm -g create-react-app (sudo is needed on macs to grant you permission, it will ask for your password, type it in and hit enter)
- npx create-react-app my-app
Should solve your problem there
I tried all the suggestion stated above but none works for me. This suggestion at 8097 works for me. Basically, I just run npx create-react-app@latest your-project-name
You can uninstall a globally installed package with this:
npm uninstall -g create-react-app
Still didn't got to know the issue. But i tried :-
npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app
This also didn't worked for me. So I uninstalled node and installed it again. It worked for me
It is not working for me on windows machine. It worked when I ran below commands from git bash:
npm install -g create-react-app
npx create-react-app my-app
Follow the following steps and that should solve your problem.
sudo npm rm -g create-react-app
(Do not skip sudo if you are a macOS user).npx create-react-app my-app
(npm 5.2+ and higher) ornpm init react-app my-app
oryarn create react-app my-app
(if you use yarn)
I had the same problem, this how I solved it.
When I try to run npm rm -g create-react-app
, it shows an error.
So I went to the node modules directory (for Mac /usr/local/lib/node_modules
) and delete create-react-app
directory and reinstall create-react-app
using npx create-react-app my-app
.
had the same issue on my mac.
The correct way is if you've previously installed create-react-app globally via npm install -g create-react-app
, you have to uninstall the package using npm uninstall -g create-react-app
in order npx to uses the latest version.
Tips: Try npx create-react-app --info
to check if npmGlobalPackages includes create-react-app. If cra is included then try the below command which create-react-app
and rm -rf the outputted path
.
Last but not least, force npx to use latest:
npx create-react-app@latest your-project-name
For Windows users who are facing this issue:
Open Task Manager and check if the Windows Command Processor process is set to Suspended.
If it is set to Suspended, open Resource Monitor and click on the CPU tab.
From within the CPU tab, locate and right-click on cmd.exe and and select Resume Process.
Click the source link below for a more detailed explanation (including screenshots).
Source: Github Issues
I solved it using following commands
- npm uninstall -g create-react-app
- yarn global add create-react-app
package.json
andnode_modules
are files and folder available. – Ankit Sinha Dec 10 '19 at 4:09