create-react-app无法生成公共文件夹和src文件夹,因此无法入门 [英] create-react-app doesn't generate public and src folders thus cannot get started
问题描述
我已经安装了CRA一个多月,并且一直使用它没有任何问题,但是今天我创建了一个新的react应用,它会构建文件夹和目录,只是它不会生成src和public文件夹(它只是生成的node-modules文件夹),因此当我运行npm start时,出现一个错误:
i have installed CRA for over a month and have been working with it without having any problems, however today i created a new react app and it builds the folders and directories except it doesn't generate src and public folder(it just generated node-modules folder) thus when i run npm start it gives me an error saying:
npm ERR! missing script: start
推荐答案
最初,您可能已在全球范围内安装了create-react-app。尝试使用 npm uninstall -g create-react-app
命令删除,然后尝试 npx create-react- app<您的应用程序名称>
。
原因是npx应该使用它的最新版本来工作。希望您的疑问现在已经清除
Initially you might have installed create-react-app globally.Try to remove using npm uninstall -g create-react-app
command and then try npx create-react-app <your-app-name>
.
The reason is, npx should use it's latest version to work. Hope your doubt is now cleared
这篇关于create-react-app无法生成公共文件夹和src文件夹,因此无法入门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!