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

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

问题描述

我正在尝试使用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创建新的React应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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