简体   繁体   English

当我尝试创建 React 应用程序时,出现“未提供模板,这可能是因为您使用的是过时版本的 create-react-app”错误

[英]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.

相关问题 npx create-react-app 不工作。 出现“create-react-app 的过时版本”错误 - npx create-react-app NOT working. Getting "outdated version of create-react-app" error 当我安装 create-react-app 时,出现“网络套接字超时”错误 - When I install create-react-app , I get a 'network Socket timeout' error 我无法通过“create-react-app”创建反应应用程序 - I'm not able to create react app by “create-react-app” 我无法通过“create-react-app”创建反应应用程序 - I'm not able to create react app by "create-react-app" 我无法使用 create-react-app 创建模板。 收到错误消息:未提供模板。 或错误 404 - I can't create a template using create-react-app. getting the error message: a template was not provided. or ERROR 404 使用带有googleapis的Create-react-app时出错 - Error using Create-react-app with googleapis wan 我使用 npx create-react-app App_Name 创建新的反应应用程序显示此错误(发现 8 个漏洞) - wan i create new react App using npx create-react-app App_Name Its Show This Error (found 8 vulnerabilities) 使用 npx create-react-app 时收到此错误消息 - Getting this error messages when using npx create-react-app Npm 尝试创建反应应用程序时出错 - Npm Error when I try to create the react app 当我尝试创建一个反应应用程序时,它会出错 - when I try to create a react app it gives an error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM