[英]when i try to create react app ,i get " template was not provided ,This is likely because you're using an outdated version of create-react-app " Error
when i try to install react app with following code当我尝试使用以下代码安装 React 应用程序时
npx create-react-app app1
i get following problem我遇到以下问题
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.
i tried npm uninstall -g create-react-app
and still it gives the same error, i don't know where the issue lies.我尝试
npm uninstall -g create-react-app
但它仍然给出相同的错误,我不知道问题出在哪里。
my system info我的系统信息
os : Windows 10 64 bit
nodeJs : v14.15.0
npm : v6.14.8
is this a problem with the node version..?这是节点版本的问题..? How to solve the issues
如何解决问题
Try to remove create-react-app from node_modules from user root and npx create-react-app myapp
should work.尝试从 root 用户的 node_modules 中删除 create-react-app, npx
npx create-react-app myapp
应该可以工作。
or或者
npx --ignore-existing create-react-app
I searched for create-react-app on my whole mac through finder and deleted that folder.我通过 finder 在我的整个 mac 上搜索了 create-react-app 并删除了该文件夹。 Then it worked
然后它起作用了
Delete the folder with the title create-react-app from your machine then npx create-react-app my-app this must fix your problem...从您的计算机中删除标题为 create-react-app 的文件夹,然后删除 npx create-react-app my-app 这必须解决您的问题...
确保在任何地方都没有名为 create-react-app 的文件:您可以使用:windows 中where create-react-app
来定位它,如果这不起作用,请在文件资源管理器中搜索并删除它,即为我工作
Implement the following steps:实施以下步骤:
npm install --global yarn<\/code>
yarn global upgrade<\/code>
yarn create react-app your-app-name<\/code>
cd your-app-name<\/code>
npm install --global yarn<\/code>
yarn global upgrade<\/code>
yarn create react-app your-app-name<\/code>
cd your-app-name<\/code>
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.