无法使用 npx create-react-app 创建新的反应应用程序 [英] Unable to create new react app with npx create-react-app

查看:29
本文介绍了无法使用 npx create-react-app 创建新的反应应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 npx create-react-app [name] 命令创建新的 React 应用程序.但我收到以下错误:

I am trying to create new react app with npx create-react-app [name] command. But I get following error:

错误在npm"注册表中找不到babel-preset-react-app@^9.1.2"所需的包@babel/plugin-transform-flow-strip-types@7.9.0".

error Couldn't find package "@babel/plugin-transform-flow-strip-types@7.9.0" required by "babel-preset-react-app@^9.1.2" on the "npm" registry.

每次都说在 npm 注册表中找不到某些(不仅是@babel/plugin-transform-flow-strip-types@7.9.0 这个包).

Each time it is saying some package could not be found on npm registry (not only @babel/plugin-transform-flow-strip-types@7.9.0 this package).

我也更新了我的 npmnpx,但没有成功.

I have also updated my npm and npx, but no success.

推荐答案

您可以尝试删除位于 Users/you/.npmrc 中的 .npmrc 文件并运行再次命令,似乎 npm 存在错误,这是一种解决方法

You can try deleting the .npmrc file located in Users/you/.npmrc and run the command again, seems there is a bug with npm and this is a workaround

这篇关于无法使用 npx create-react-app 创建新的反应应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆