create-react-app 在对 registry.npmjs.org/react 执行 GET 请求时挂起
create-react-app hangs when performing GET request for registry.npmjs.org/react
我正在尝试使用 create-react-app
创建我的第一个项目,但是它挂在下面的这个微调器上,那只是 react
旁边的一个圆圈旋转的句点。
> npx create-react-app github-finder --verbose
Creating a new React app in C:\dev\react-training\github-finder.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.12.1
verbose 0.2505522 Checking for configuration file "C:\dev\react-training\github-finder\.npmrc".
verbose 0.251879 Checking for configuration file "C:\Users\rizers\.npmrc".
verbose 0.2541254 Found configuration file "C:\Users\rizers\.npmrc".
verbose 0.2556172 Checking for configuration file "C:\Program Files\nodejs\etc\npmrc".
verbose 0.2563122 Checking for configuration file "C:\dev\react-training\github-finder\.npmrc".
verbose 0.256965 Checking for configuration file "C:\dev\react-training\.npmrc".
verbose 0.2575825 Checking for configuration file "C:\dev\.npmrc".
verbose 0.2660975 Checking for configuration file "C:\dev\react-training\github-finder\.yarnrc".
verbose 0.2670012 Checking for configuration file "C:\Users\rizers\.yarnrc".
verbose 0.2683534 Found configuration file "C:\Users\rizers\.yarnrc".
verbose 0.2701472 Checking for configuration file "C:\Program Files\nodejs\etc\yarnrc".
verbose 0.2721652 Checking for configuration file "C:\dev\react-training\github-finder\.yarnrc".
verbose 0.2730678 Checking for configuration file "C:\dev\react-training\.yarnrc".
verbose 0.2738477 Checking for configuration file "C:\dev\.yarnrc".
verbose 0.2810919 current time: 2021-02-26T19:14:21.831Z
verbose 0.4244942 Performing "GET" request to "https://yarnpkg.com/latest-version".
[1/4] Resolving packages...
verbose 0.5258425 Performing "GET" request to "https://registry.npmjs.org/react".
⢀ react
我当前的 Node 版本是 14.16.0,我当前的 React 版本是 7.6.0。
看来一个非常简单的命令选项解决了我的问题。我在 create-react-app
文档中注意到 there is an option to use npm 在构建 React 应用程序时,特别是 --use-npm
。添加这个答案以防其他人像我一样疯狂地谷歌搜索这个问题有同样的问题。
我正在尝试使用 create-react-app
创建我的第一个项目,但是它挂在下面的这个微调器上,那只是 react
旁边的一个圆圈旋转的句点。
> npx create-react-app github-finder --verbose
Creating a new React app in C:\dev\react-training\github-finder.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.12.1
verbose 0.2505522 Checking for configuration file "C:\dev\react-training\github-finder\.npmrc".
verbose 0.251879 Checking for configuration file "C:\Users\rizers\.npmrc".
verbose 0.2541254 Found configuration file "C:\Users\rizers\.npmrc".
verbose 0.2556172 Checking for configuration file "C:\Program Files\nodejs\etc\npmrc".
verbose 0.2563122 Checking for configuration file "C:\dev\react-training\github-finder\.npmrc".
verbose 0.256965 Checking for configuration file "C:\dev\react-training\.npmrc".
verbose 0.2575825 Checking for configuration file "C:\dev\.npmrc".
verbose 0.2660975 Checking for configuration file "C:\dev\react-training\github-finder\.yarnrc".
verbose 0.2670012 Checking for configuration file "C:\Users\rizers\.yarnrc".
verbose 0.2683534 Found configuration file "C:\Users\rizers\.yarnrc".
verbose 0.2701472 Checking for configuration file "C:\Program Files\nodejs\etc\yarnrc".
verbose 0.2721652 Checking for configuration file "C:\dev\react-training\github-finder\.yarnrc".
verbose 0.2730678 Checking for configuration file "C:\dev\react-training\.yarnrc".
verbose 0.2738477 Checking for configuration file "C:\dev\.yarnrc".
verbose 0.2810919 current time: 2021-02-26T19:14:21.831Z
verbose 0.4244942 Performing "GET" request to "https://yarnpkg.com/latest-version".
[1/4] Resolving packages...
verbose 0.5258425 Performing "GET" request to "https://registry.npmjs.org/react".
⢀ react
我当前的 Node 版本是 14.16.0,我当前的 React 版本是 7.6.0。
看来一个非常简单的命令选项解决了我的问题。我在 create-react-app
文档中注意到 there is an option to use npm 在构建 React 应用程序时,特别是 --use-npm
。添加这个答案以防其他人像我一样疯狂地谷歌搜索这个问题有同样的问题。