【问题标题】:How to fix yarn causing trouble while creating react-app如何在创建 react-app 时修复导致问题的纱线
【发布时间】:2020-07-19 10:42:49
【问题描述】:

我想用create-react-app react-app 创建一个 React 应用程序,但出现以下错误

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

yarn add v1.13.0
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > jest-environment-jsdom-fourteen > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/314
2
info There appears to be trouble with your network connection. Retrying...
warning react-scripts > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/req
uest/request/issues/3142
warning react-scripts > resolve-url-loader > rework > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-scripts > resolve-url-loader > rework > css > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-scripts > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning react-scripts > resolve-url-loader > rework > css > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > strip-comments > babel-plugin-transform-object-rest-spread > babel-runtime > core-js@2.6.11: co
re-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3
.
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@svgr/webpack/-/webpack-4.3.3.tgz: tunneling socket could not be established, cause=connect EC
ONNREFUSED 127.0.0.1:3128".


Aborting installation.

我在公司代理后面工作,但这是设置,我可以通过 npm 安装软件包,例如 npm i -g create-react-appnpm i winston 等,没有问题。 我用谷歌搜索了这个问题并尝试了类似的方法:

yarn install --network-timeout 1000000

我配置了 npm 代理和 yarn 代理,但这也不起作用。 如果我尝试这样的事情:'Yarn install' cause 'trouble with network connection' 我什至不能再使用 npm install 了。

【问题讨论】:

    标签: reactjs npm yarnpkg


    【解决方案1】:

    这似乎只是您的互联网连接问题。
    如果您在 Windows 上,请尝试删除临时文件并重新启动路由器。

    如果这不能解决您的问题,请考虑重新启动您的机器。也许它可能会有所帮助。

    【讨论】:

      猜你喜欢
      • 2022-01-16
      • 2017-08-21
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 2020-05-09
      • 1970-01-01
      • 2019-08-03
      相关资源
      最近更新 更多