public, src,and scripts folder not created while using create-react-app

廉价感情. 提交于 2020-05-25 06:27:26

问题


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.


回答1:


Try with these steps :

  1. npm rm -g create-react-app
  2. npm install -g create-react-app
  3. npx create-react-app my-app

Source




回答2:


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:

  1. 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)
  2. npx create-react-app my-app

Should solve your problem there




回答3:


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



回答4:


You can uninstall a globally installed package with this: npm uninstall -g create-react-app




回答5:


The thing that worked for me is:

npm rm -g create-react-app
npm install -g create-react-app
npx create-react-app my-app



回答6:


Follow the following steps and that should solve your problem.

  1. sudo npm rm -g create-react-app (Do not skip sudo if you are a macOS user).

  2. npx create-react-app my-app (npm 5.2+ and higher) or npm init react-app my-app or yarn create react-app my-app (if you use yarn)




回答7:


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




回答8:


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



来源:https://stackoverflow.com/questions/59260031/public-src-and-scripts-folder-not-created-while-using-create-react-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!