创建包时无法在 "npm" 注册表中找到包 "react"

Couldn't find package "react" on the "npm" registry when creating a package

我正在尝试创建一个新的 React 项目并使用下面的命令

npx create-react-app login

并且安装失败,提示“在“npm”注册表中找不到软件包“react””。

留言:

Creating a new React app in C:\Amit\Code\Experiment\TestConsoleApp\login.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.7.0
[1/4] Resolving packages...
error Couldn't find package "react" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this comm
and.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Amit\C
ode\Experiment\TestConsoleApp\login has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting login/ from C:\Amit\Code\Experiment\TestConsoleApp
Done.

尝试删除 npm 注册表

npm config delete registry
npm config set registry https://registry.npmjs.org/

...遇到相同错误时为我工作