Create-react-app 不起作用,不加载“src”、“public”或“gitignore”文件

问题描述 投票:0回答:1

对于编码来说是新的,但这应该可以工作,但由于某种原因却不起作用。当我执行 Create-react-app 时,它仅加载 node_modules 和 2 个 json 文件。

我需要将其用于我正在进行的项目。 Vite 与所有文件完美配合,但我需要为此使用 create-react-app 。

我已经重新安装了几次node和npm以及vscode,并确保它们已更新。我在全球安装了 create-react-app,它甚至说我有最新版本。

没有弹出错误消息...它只是安装了一半,然后似乎已完成,因为它没有尝试加载任何其他内容。感谢任何帮助,谢谢!

node.js create-react-app
1个回答
-1
投票

您可以尝试使用模板

npx create-react-app my-app --template cra-template-typescript
。可用模板 cra-template-* 可以在 npm 中找到。或者如果您的 npm 版本是 6+。尝试使用这个命令
npm init react-app my-app

© www.soinside.com 2019 - 2024. All rights reserved.