The 'npx create-react-app command' doesn't correctly work

为君一笑 提交于 2021-02-11 13:53:33

问题


As we know, there are a lot of questions in this community about npx create-react-app, but none of them couldn't solve my problem. I had used npx create-react-app several times and I didn't have any problem with it, but from a couple of days ago when I run this command, my project is created but in its folder, there isn't any files and folders that I expected to exist in it (except node_modules, package.json, and yarn.lock). For solving my problem, I updated Node.js and uninstall and reinstall the create-react-app, but my problem didn't solve. I'm using the Yarn for package management.

my-app
├── node_modules
├── yarn.lock
└── package.json

回答1:


There is a tiny point in this problem, and it is There is global installs of create-react-app are no longer supported. So at the first, run this command

npm uninstall -g create-react-app

Then install create-react-app in this way

npm install create-react-app

Then create your react app

npx create-react-app my-app


来源:https://stackoverflow.com/questions/61805056/the-npx-create-react-app-command-doesnt-correctly-work

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