“npx create-react-app 命令"无法正常工作 [英] The 'npx create-react-app command' doesn't correctly work
问题描述
我们知道,这个社区有很多关于 npx create-react-app
的问题,但没有一个不能解决我的问题.我已经多次使用 npx create-react-app
并且我没有任何问题,但是从几天前当我运行此命令时,我的项目已创建,但在其文件夹中,其中没有我希望存在的任何文件和文件夹(node_modules、package.json 和 yarn.lock 除外).为了解决我的问题,我更新了 Node.js 并卸载并重新安装了 create-react-app
,但我的问题没有解决.我正在使用 Yarn 进行包管理.
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
推荐答案
这个问题有一个小问题,就是不再支持create-react-app
的全局安装.所以首先,运行这个命令
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
然后这样安装create-react-app
npm install create-react-app
然后创建你的反应应用
npx create-react-app my-app
这篇关于“npx create-react-app 命令"无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!