Create-React-App Unexpected Connection Refused

感情迁移 提交于 2021-01-28 14:15:58

问题


I keep getting the below error when I try to simply create a new react app. I even set up fiddler on my computer and set my proxy to work with that but I am still getting the following error:

ECONNREFUSED 13.107.6.183:443

Click here for the complete log

$ create-react-app testmeup

Creating a new React app in C:\***\source\Dev\testmeup.

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

yarn add v1.15.2
[1/4] Resolving packages...
error An unexpected error occurred: "https://pkgs.dev.azure.com/AdmInvestorServices/_packaging/test/npm/registry/react: connect ECONNREFUSED 13.107.6.183:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\****\\source\\Dev\\testmeup\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\***\Dev\testmeup has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.

回答1:


This appears to be an issue with your proxy settings since when you're running create-react-app <app_name> yarn is unable to resolve the necessary dependencies to set up your new react project, namely: react, react-dom, and react-scripts.

Maybe you could try setting your proxy settings so you can install the necessary libraries create-react-app needs. According to yarn's documentation:

"For backward compatiibilty with npm, Yarn allows passing down npm configuration via environment variables."

So maybe you could try the following and seeing if this helps resolve your issue:

npm config set proxy <proxy_url>
npm config set https-proxy <proxy_url>

where the <proxy_url> is changed to work with your appropriate proxy. Then you can tell yarn to ignore ssl if necessary. Note: Use at your own discretion.

yarn config set strict-ssl false

npm config set <key> <value> sets npm environment variables which yarn can also utilize. In this particular case we are setting the proxy environment variables. Now simply try running the create-react-app command again and it should be able to proceed with setting up the new react project for you.

Hopefully that helps!



来源:https://stackoverflow.com/questions/55795574/create-react-app-unexpected-connection-refused

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!