为什么react creat app中缺少src和公用文件夹?

我正在尝试使用npx create-react-app my-app创建创建应用

我有npm 6.13

和节点:12.14.1

我厌倦了跟随create-react-app doesn't generate public and src folders thus cannot get started

中的灵魂

但是它不起作用吗?

有机会吗?

lflxyz 回答:为什么react creat app中缺少src和公用文件夹?

您可能已经在全局安装了create-react-app。但npx始终使用最新版本的create-react-app。请通过

检查create-react-app版本
create-react-app -v

,并通过检查Changelog.md确保其最新。如果不是,请尝试通过

卸载全局软件包
sudo npm uninstall -g create-react-app

确保已全局卸载,然后尝试运行

npx create-react-app <project_name>
,

最初尝试使用,但不起作用:npm rm -g create-react-appnpm install -g create-react-appnpx create-react-app <your-app-name>

以下命令有效:npx --ignore-existing create-react-app <Your-AppName>

本文链接:https://www.f2er.com/2719152.html

大家都在问