React src and public folders missing - reactjs

I am trying to create a react app. When I run the npx create-react-app myapp command, this is what happens. I know I can ignore the vulnerabilities but the src and public folders are missing in the app folder.
How can I get the missing folders?

follow this steps
remove create-react-app
npm uninstall -g create-react-app
2)update npm npx using the following commands.
npm update npx
and run the final step
npx create-react-app my-app

Run these commands as follow :
npm i -g npm
npm uninstall -g create-react-app
npm updates npx
npx create-react-app app-name

Related

I am facing this problem while doing npx create-react-app can anyone help me?

You are running create-react-app 4.0.3, which is behind the latest release (5.0.0).
We no longer support global installation of Create React App.
Please remove any global installs with one of the following commands:
npm uninstall -g create-react-app
yarn global remove create-react-app
The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/
After:
npm uninstall -g create-react-app
npm cache clean --force
npm cache verify
Try this :
npx clear-npx-cache to clear your npx cache.
npx create-react-app your-app or npx create-react-app#latest my-app --use-npm

i am getting an error when creating a react app using npx

npx create-react-app my-app
Error:
We no longer support the global installation of Create React App.
Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app
I tried
npm uninstall -g create-react-app
and then
npx create-react-app my-app
but it still gives me the same error
node --version v14.17.6
npm --version 8.1.1
Try this out i am having the same problem and fixed it ny cleaning cache and then run npx create-react-app my-app
npm cache clean --force
npx create-react-app myapp
for further guidance check out this previous answer
I can't install react using npx create-react-app?
you can also check offical documentation.
https://reactjs.org/docs/create-a-new-react-app.html#create-react-app

Src folder is not created while create-react-app

While creating the react-app by = " npm create-react-app "
src and public folder are not created
I tried:
npx craete-raect-app
npm rm -g create-react-app,
npm install -g create-react-app,
npx create-react-app .
npx --ignore-existing create-react-app Your-AppName
i tried these all but failed to create the src folder.
Try to run this command npx craete-raect-app app-name
First of all check whether you have node installed on your machine:
Run this command:
node -v
It will show your node version if installed.
Next step you are not even creating an app. Give it a name app-name
npx create-react-app app-name
This will create your app with src and public folder inside it.
Go to your app by:
cd app-name
npm start

npx create-react-app not generating public and src folder

Public and src folder is not generated in my react project when I execute npx create-react-app myest.
I tried unstalling the global create-react-app using npm uinstall -g create-react-app and reinstalling it again using npm install -g create-react-app. However, after I execute npx create-react-app myest, it got stuck on the below screen
initially tried using but not worked:
npm rm -g create-react-app,
npm install -g create-react-app,
npx create-react-app <your-app-name>.
below command works :
npx --ignore-existing create-react-app Your-AppName

It say missing dependencies in package json

this is the error message that shows when i try to install react I'm setting up a new project for react, and when I try to npm install create-react-app it shows error like missing dependencies in package.json.
npm install create-react-app
npm install create-react-app my-app
I expected that the dependencies should be added inside my package.json but nothing appers.
If you have installed npm 5.2+, you can just use npx to execute node packages, or you need to install create-react-app globally to make it executable globally.
npm version
npm install -g create-react-app
create-react-app my-app
npx version
npx create-react-app my-app

Resources