繁体   English   中英

为什么 create-react-app 不创建应用程序的主体?

[英]Why create-react-app don't create the body of the app?

我想使用npx create-react-app my-app创建一个反应应用程序,它运行并创建一个包含 node_modules、package.json 和 yarn.lock 的文件夹,没有 src 和 public 文件夹,它返回的模板没有提供,这很可能您使用的是过时的 create-react-app 版本,就像你们在屏幕截图中看到的那样。

节点 v16.15.1,npm v7.24.2

这是我使用的这个命令

这是最终的结果

您是否尝试过写在最后一行的命令: npm uninstall -g create-react-app 然后用npx create-react-app my-app再试一次

我终于找到了解决方案。 我只需要删除 node_modules 中的 create-react-app 文件夹,因为卸载命令不起作用并运行此命令npm install create-react-app@latest然后问题就解决了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM