您好,我在 create-react-app 方面遇到一些问题:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
npm WARN 已弃用 [电子邮件受保护]:不再支持此 SVGO 版本。升级到v2.x.x.
添加了1376个包,并在22m内审核了1377个包
181个套餐正在寻求资金 运行
npm fund
了解详情
6 个中等严重程度的漏洞
要解决所有问题,请运行: npm 审计修复
运行
npm audit
了解详细信息。
未提供模板。这可能是因为您使用的是过时版本的 create-react-app。 请注意,不再支持 create-react-app 的全局安装。 您可以通过在再次使用 create-react-app 之前运行 npm uninstall -g create-react-app 或 yarn global remove create-react-app 来修复此问题。
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>
我尝试了create-react-app官网推荐的步骤: npm uninstall -g create-react-app - 这不起作用。
我已经清除了npm缓存,也没有用。
我用“where create-react-app”进行搜索,这样我就可以删除它,但它没有任何问题。
有人可以帮我解决这个问题吗?非常感谢。
在尝试了很多类似的答案后,我找到的解决方案如下:
npm uninstall -g create-react-app
npm cache clean --force
npx create-react-app@latest your-app-name
注意“@latest”create-react-app。
希望有帮助
我已经尝试了我找到的所有解决方案。经过几个小时的努力,我终于找到了这个可以在我的 Mac 上运行的解决方案。
转到 Macintosh HD > 用户 >“您的用户名”> node_modules
如果您有一个名为 create-react-app 的文件夹,请将其删除。
这对我有用,现在我不需要每次创建新的 React 应用程序时都添加 @latest。
运行:
npx 清除 npx 缓存
npx create-react-app@最新的你的应用程序