尝试使用 npx create-react-app 时出现超时错误

2024-01-09

当我尝试运行此程序时,出现此错误:

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)

这是日志中发生的情况:

205 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected] /cdn-cgi/l/email-protection: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
206 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
207 verbose type body-timeout
208 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)
208 verbose stack     at Timeout._onTimeout (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
208 verbose stack     at listOnTimeout (internal/timers.js:549:17)
208 verbose stack     at processTimers (internal/timers.js:492:7)
209 verbose cwd C:\Users\Acc\mern-todo-app
210 verbose Windows_NT 10.0.18362
211 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts" "cra-template"
212 verbose node v12.16.2
213 verbose npm  v6.14.4
214 error Response timeout while trying to fetch https://registry.npmjs.org/@typescript-eslint%2fparser (over 30000ms)
215 verbose exit [ 1, true ]

我对此很陌生,所以我不知道发生了什么。


我也遇到了这个问题,我尝试通过在其中添加超时来使用此代码,它的工作方式就像一个魅力。

npx create-react-app my-app -timeout=60000

这里 60000 是 60 秒。您可以根据自己的选择增加时间。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

尝试使用 npx create-react-app 时出现超时错误 的相关文章

随机推荐