简体   繁体   English

每当我尝试创建一个反应应用程序时,它都会显示以下错误,我尝试了日志文件也显示了代理错误

[英]whenever I try to create a react app , it shows the following error, I tried the log file also it shows the proxy error

the following error is in cmd Installing packages.以下错误在 cmd 安装包中。 This might take a couple of minutes.这可能需要几分钟时间。 Installing react, react-dom, and react-scripts with cra-template...使用 cra-template 安装 react、react-dom 和 react-scripts...

npm ERR! npm 错误! code ERR_SOCKET_TIMEOUT npm ERR!代码 ERR_SOCKET_TIMEOUT npm 错误! errno ERR_SOCKET_TIMEOUT npm ERR!.network Invalid response body while trying to fetch https://registry.npmjs.org/core-js-pure : Socket timeout npm ERR..network This is a problem related to.network connectivity. errno ERR_SOCKET_TIMEOUT npm ERR!.network Invalid response body while trying to fetch https://registry.npmjs.org/core-js-pure : Socket timeout npm ERR..network 这是与.network 连接相关的问题。 npm ERR,.network In most cases you are behind a proxy or have bad.network settings. npm ERR,.network 在大多数情况下,您在代理后面或有错误的.network 设置。 npm ERR:.network npm ERR!.network If you are behind a proxy, please make sure that the npm ERR!.network 'proxy' config is set properly. npm ERR:.network npm ERR!.network 如果您使用代理,请确保 npm ERR!.network 'proxy' 配置设置正确。 See: 'npm help config'请参阅:'npm 帮助配置'

the following error shows in log file error code ERR_SOCKET_TIMEOUT 5168 error errno ERR_SOCKET_TIMEOUT 5169 error.network Invalid response body while trying to fetch https://registry.npmjs.org/core-js-pure : Socket timeout 5170 error.network This is a problem related to.network connectivity.以下错误显示在日志文件错误代码 ERR_SOCKET_TIMEOUT 5168 error errno ERR_SOCKET_TIMEOUT 5169 error.network Invalid response body while trying to fetch https://registry.npmjs.org/core-js-pure : Socket timeout 5170 error.network 这是一个与网络连接相关的问题。 5170 error.network In most cases you are behind a proxy or have bad.network settings. 5170 error.network 在大多数情况下,您使用了代理或有错误的网络设置。 5170 error.network 5170 error.network If you are behind a proxy, please make sure that the 5170 error.network 'proxy' config is set properly. 5170 error.network 5170 error.network 如果您使用代理,请确保 5170 error.network“代理”配置设置正确。 See: 'npm help config'请参阅:'npm 帮助配置'

This error is possibly occurring due to the speed of inte.net connection or proxy configuration.由于互联网连接或代理配置的速度,可能会发生此错误。

  • If the inte.net connection being used is slow, you can set fetch-retry-mintimeout and fetch-retry-maxtimeout to higher values.如果正在使用的 inte.net 连接很慢,您可以将fetch-retry-mintimeoutfetch-retry-maxtimeout为更高的值。

    You can check existing values for above parameters by using:您可以使用以下方法检查上述参数的现有值:

     npm config get fetch-retry-mintimeout # gives fetch-retry-mintimeout value in milliseconds
     npm config get fetch-retry-maxtimeout # gives fetch-retry-maxtimeout value in milliseconds

    In order to set new values, use:要设置新值,请使用:

     npm config set fetch-retry-mintimeout 100000 # 100s npm config set fetch-retry-maxtimeout 120000 # 120s
  • If the above step doesn't resolve the problem, you can also check your proxy config by:如果上述步骤不能解决问题,您还可以通过以下方式检查您的代理配置:

     npm config get proxy
     npm config get https-proxy

    Proxy settings can be removed by using可以使用删除代理设置

    npm config rm proxy
     npm config rm https-proxy

Reference: npm ERR!参考: npm 错误! code ERR_SOCKET_TIMEOUT on creating new project using ng new appname 使用 ng new appname 创建新项目的代码 ERR_SOCKET_TIMEOUT

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每当我尝试创建新的反应应用程序或尝试启动现有的反应应用程序时出现错误 - Getting error whenever I try to create new react app or try to start existing react app 我用 create-react-app 创建了一个项目。 在我的 windows 电脑上,但当我尝试在命令行上运行 npm 时,它显示了这个错误。请帮助我 - I created a project with create-react-app. on my windows pc but when is try to run npm start on the command line it shows this error.please help me 我尝试将我的后端连接到数据库(mongodb)。 但是,它显示了这个错误 - I tried connecting my backend to database(mongodb). But, It shows this error 为什么当我尝试将 javascript 文件链接到 html 时浏览器显示找不到文件错误? - why is the browser shows me file not found error when i try to link javascript file to html? 当我尝试提交 HTML 表单时显示错误“无法 POST” - Shows error “Cannot POST” when I try to submit the HTML form 当我尝试提交HTML表单时显示错误“无法POST” - Shows error “Cannot POST” when I try to submit the HTML form 我正在尝试克隆git存储库,但显示代理错误 - I'm trying to clone a git repository but it shows a proxy error Npm 尝试创建反应应用程序时出错 - Npm Error when I try to create the react app 我使用JS添加了一行,但它在几秒/毫秒后立即被删除,控制台日志也显示没有错误 - I added a row using JS, but it gets immediately deleted after a few seconds/miliseconds, the console log also shows no error 无法使用 create-react-app,因为它显示以下错误 - Cannot use create-react-app as it shows below error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM