Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Getting constant FetchError...reason: Socket timeout when installing packages #3078

Closed
ruluva opened this issue Apr 15, 2021 · 80 comments · Fixed by npm/minipass-fetch#53
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@ruluva
Copy link

ruluva commented Apr 15, 2021

Current Behavior:

When trying to install packages, without a previous cache, we get constant timeouts when trying to fetch packages, both locally and in a CI environment. The package that fails is always different, so there isn't a specific package causing the issue.

Stack trace:

19505 verbose stack FetchError: request to https://.../npm/registry/typescript/-/typescript-4.1.3.tgz failed, reason: Socket timeout
19505 verbose stack     at ClientRequest.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\minipass-fetch\lib\index.js:97:14)
19505 verbose stack     at ClientRequest.emit (events.js:315:20)
19505 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:469:9)
19505 verbose stack     at TLSSocket.emit (events.js:327:22)
19505 verbose stack     at emitErrorNT (internal/streams/destroy.js:106:8)
19505 verbose stack     at emitErrorCloseNT (internal/streams/destroy.js:74:3)
19505 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
19506 verbose cwd D:\a\1\s
19507 verbose Windows_NT 10.0.17763
19508 verbose argv "C:\\hostedtoolcache\\windows\\node\\14.15.4\\x64\\node.exe" "C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js" "ci" "--no-audit"
19509 verbose node v14.15.4
19510 verbose npm  v7.9.0
19511 error code ERR_SOCKET_TIMEOUT
19512 error errno ERR_SOCKET_TIMEOUT
19513 error request to https://.../npm/registry/typescript/-/typescript-4.1.3.tgz failed, reason: Socket timeout
19514 verbose exit 1

Tried using the fetch-retries, fetch-retry-mintimeout, and fetch-retry-maxtimeout options, but didn't seem to have any effect.

Expected Behavior:

Install packages without timing out.

Steps To Reproduce:

Using a project with workspaces (~6425 packages)
No cache available
Run npm ci

Environment:

OS: Mac OS 11.2.3 or Windows 10
Node: 14.15.4
npm: 7.9.0

@ruluva ruluva added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Apr 15, 2021
@ruluva ruluva changed the title [BUG] Getting constant 'FetchError...reason: Socket timeout' when installing packages [BUG] Getting constant FetchError...reason: Socket timeout when installing packages Apr 15, 2021
@nlf
Copy link
Contributor

nlf commented Apr 15, 2021

judging by the path in your issue, i'm guessing that you are using a custom registry and not the npm one?

these socket timeouts seem like an issue with either your registry itself or the network connection between the computer you're installing packages on and your registry host. if you can, you might try installing some packages using the official npm registry just to see if you continue to have issues. if something like npm install react --registry=https://registry.npmjs.org in an empty directory still shows you socket timeout errors it seems likely the problem is with your computer. if not, sounds like it's an issue with your custom registry.

let us know what you find!

@ruluva
Copy link
Author

ruluva commented Apr 15, 2021

Yeah, this is going through a custom Visual Studio registry. And it has been an issue on most of the machines from the team as well as the build pipelines. I can try to repro it with the npmjs registry, but it seems to only occur on bigger projects, since I didn't face the issue on a smaller one during testing.

@nlf
Copy link
Contributor

nlf commented Apr 15, 2021

you might try experimenting with the --maxsockets option too, the default is 15 but it could be you need to reduce it a bit further.

@ruluva
Copy link
Author

ruluva commented Apr 15, 2021

So reducing might help with this issue? Is this because it might overloading it?

@nlf
Copy link
Contributor

nlf commented Apr 15, 2021

yeah, that's what i'm thinking. potentially reducing the number of concurrent requests will give the registry a better chance at handling them. it could be reducing that number enough will avoid the timeouts entirely. it's certainly worth a try, anyway.

@darcyclarke darcyclarke added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Apr 15, 2021
@darcyclarke darcyclarke added this to the OSS - Sprint 28 milestone Apr 15, 2021
@ruluva
Copy link
Author

ruluva commented Apr 15, 2021

Sounds good, let me play around with a couple different values, and I'll post any results.

@ruluva
Copy link
Author

ruluva commented Apr 15, 2021

So I tried 10, 5, and 1 for maxsockets, and I was still getting the same timeout issues.

@nlf
Copy link
Contributor

nlf commented Apr 16, 2021

interesting.. so we're left with trying to reproduce this against the npm registry, which as you mentioned is somewhat difficult. installing the react package fetches quite a few dependencies and may be enough to trigger it for you.

do you have a proxy in use, by chance? i'm just trying to determine what else may be in the network between the computer doing the installation and the registry itself.

@josephliccini
Copy link

@nlf this is a MSFT internal registry, we could get a on a Teams call and debug if that's helpful?

@ruluva
Copy link
Author

ruluva commented Apr 21, 2021

So we followed up with the Azure Devops team in terms of our registry, to get an idea of whether that was causing an issue, and from their side, they aren't even seeing the timeout calls. So they believe it might be some logic in NPM that might be throwing a timeout for the wrong reason.
I tried to replicate this by setting up a Fiddler proxy to see the NPM get requests, and I see the successful ones as well as the redirects to the blob storage associated with them, but I never saw the request that timed out.

@nlf
Copy link
Contributor

nlf commented Apr 22, 2021

so we're timing out requests that were never even actually sent? that's.. surprising, and strange.

do you, by chance, use vsts-npm-auth?

@ruluva
Copy link
Author

ruluva commented Apr 22, 2021

Yeah, I can share the fiddler trace if that helps.

Most of the team does, but there are a couple people on the team that have Macs, so we set the .npmrc authentication manually.

@nlf
Copy link
Contributor

nlf commented Apr 22, 2021

Most of the team does, but there are a couple people on the team that have Macs, so we set the .npmrc authentication manually.

hmm, ok. and you already said the folks on macs are seeing this problem too, so we definitely can't point to vsts-npm-auth as a source of the problem.

Yeah, I can share the fiddler trace if that helps.

i'll reach out to you in a higher bandwidth way either this afternoon or tomorrow morning (pacific timezone) so we can try to debug a bit more.

@ruluva
Copy link
Author

ruluva commented Apr 22, 2021

Yeah, definitely seeing this issue as well on my Mac.

Sounds good, I'm on Teams if that helps or whichever way is fine.

@Keysox
Copy link

Keysox commented May 5, 2021

We're seeing this same error with these versions:

  • node 15.11.0 / npm 7.6.0
  • node 16.0.0 / npm 7.10.0

The interesting thing is that it'll timeout within 4 seconds of a previous 200 and not retry at all when a 502 is encountered using the defaults specified here: https://docs.npmjs.com/cli/v7/using-npm/config#fetch-retries.

Is there any update on this issue or workarounds we should try?

@darcyclarke
Copy link
Contributor

Update

@vishaldix
Copy link

i'm having the same problem when use npx create-react-app my-app even though my internet connection is fine, i have been stuck on this for five days i have tried every thing in this link https://stackoverflow.com/questions/18419144/npm-not-working-read-econnreset

PS C:\Users\Khldon\Desktop\react bascs> npx create-react-app my-app

Creating a new React app in C:\Users\Khldon\Desktop\react bascs\my-app.

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

npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/eslint-config-react-app: Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
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.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Khldon\AppData\Local\npm-cache\_logs\2022-03-10T18_23_30_605Z-debug.log

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting my-app/ from C:\Users\Khldon\Desktop\react bascs
Done.

did you find a solution?

@simllll
Copy link

simllll commented Mar 29, 2022

Something that could be related: npm/statusboard#442 (comment)

@terrasoff
Copy link

I've spent probably 40+ hours trying to reproduce this in a testing environment where it can be repeatable.

You can reproduce the issue on slow unstable connections.

@swinster
Copy link

swinster commented May 13, 2022

Just a quick follow up on this. I was having a major issue trying to run npm ci when setting up Zigbee2MQTT (see https://www.zigbee2mqtt.io/guide/installation/01_linux.html#installing) suffering from this Socket Timeout error. I'm using an old Raspberry Pi Model B (so v1) and perhaps there is some odd NIC setting incorrect. However, other network related tasks are fine, fast and stable (e.g. curl, get, SSH, updating the OS, etc). Forcing npm to update to v8.10 seem to resolved the socket timeout issue for me, albeit running npm ci was still very slow and there were a lot of cache misses. However, there is still an issue :(.

Now I saw a Fetch error towards the end of running npm ci, but this time with a Client network socket disconnected before secure TLS connection was established error. The last few lines of the logs show:

2502 http fetch GET 200 https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz 5702108ms (cache miss)
2503 timing reifyNode:node_modules/typescript Completed in 5738411ms
2504 timing reify:rollback:createSparse Completed in 160355ms
2505 timing reify:rollback:retireShallow Completed in 3ms
2506 timing command:ci Completed in 5944771ms
2507 verbose type system
2508 verbose stack FetchError: request to https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz failed, reason: Client network socket disconnected before secure TLS connection was established
2508 verbose stack     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
2508 verbose stack     at ClientRequest.emit (node:events:527:28)
2508 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:454:9)
2508 verbose stack     at TLSSocket.emit (node:events:539:35)
2508 verbose stack     at emitErrorNT (node:internal/streams/destroy:157:8)
2508 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:122:3)
2508 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
2509 verbose cwd /opt/zigbee2mqtt
2510 verbose Linux 5.15.32+
2511 verbose node v16.15.0
2512 verbose npm  v8.10.0
2513 error code ECONNRESET
2514 error errno ECONNRESET
2515 error network request to https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz failed, reason: Client network socket disconnected before secure TLS connection was established
2516 error network This is a problem related to network connectivity.
2516 error network In most cases you are behind a proxy or have bad network settings.
2516 error network
2516 error network If you are behind a proxy, please make sure that the
2516 error network 'proxy' config is set properly.  See: 'npm help config'
2517 verbose exit 1
2518 timing npm Completed in 5950278ms
2519 verbose unfinished npm timer reify 1652438379317
2520 verbose unfinished npm timer reify:unpack 1652438391931
2521 verbose unfinished npm timer reifyNode:node_modules/eslint/node_modules/color-name 1652438394202
2522 verbose unfinished npm timer reifyNode:node_modules/eslint/node_modules/color-convert 1652438394205
2523 verbose unfinished npm timer reifyNode:node_modules/cliui 1652438394516
2524 verbose unfinished npm timer reifyNode:node_modules/babel-plugin-jest-hoist 1652438394647
2525 verbose unfinished npm timer reifyNode:node_modules/@babel/plugin-proposal-async-generator-functions 1652438395576
2526 verbose unfinished npm timer reifyNode:node_modules/@babel/generator 1652438395719
2527 verbose code 1
2528 error A complete log of this run can be found in:
2528 error     /home/pi/.npm/_logs/2022-05-13T10_39_03_016Z-debug-0.log

Just to double check this file, I ran wget, which was fine:

pi@raspberrypi:/opt/zigbee2mqtt $ wget https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz
--2022-05-13 13:21:46--  https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz
Resolving registry.npmjs.org (registry.npmjs.org)... 104.16.20.35, 104.16.26.35, 104.16.23.35, ...
Connecting to registry.npmjs.org (registry.npmjs.org)|104.16.20.35|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2868 (2.8K) [application/octet-stream]
Saving to: ‘color-name-1.1.4.tgz’

color-name-1.1.4.tgz                100%[=================================================================>]   2.80K  --.-KB/s    in 0.002s  

2022-05-13 13:21:46 (1.50 MB/s) - ‘color-name-1.1.4.tgz’ saved [2868/2868]

NOTE: there is NO HTTP proxy involved on this network.

Perhaps I should open a new issue.

@turbodude
Copy link

I have this issue when cloning a github repo. Network speed and connection should be fine... Windows 11, npm 8.13.2, node 18.6.0 (as well as v16.16.0).
Tried increasing timeouts, cleaning cache...

PS C:\Users\username> gatsby new project https://github.com/LinkedInLearning/learning-gatsby-3156789
info Creating new site from git: https://github.com/LinkedInLearning/learning-gatsby-3156789.git

Cloning into 'project'...
remote: Enumerating objects: 96, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 96 (delta 3), reused 85 (delta 2), pack-reused 0
Receiving objects: 100% (96/96), 1.96 MiB | 2.58 MiB/s, done.
success Created starter directory layout
info Installing packages...

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! network Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
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.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:

 ERROR

Command failed with exit code 1: npm install



  Error: Command failed with exit code 1: npm install

  - error.js:60 makeError
    [npm]/[gatsby-cli]/[execa]/lib/error.js:60:11

  - index.js:118 handlePromise
    [npm]/[gatsby-cli]/[execa]/index.js:118:26

  - task_queues:95 processTicksAndRejections
    node:internal/process/task_queues:95:5

  - init-starter.js:135 install
    [npm]/[gatsby-cli]/lib/init-starter.js:135:7

  - init-starter.js:202 clone
    [npm]/[gatsby-cli]/lib/init-starter.js:202:3

  - init-starter.js:343 initStarter
    [npm]/[gatsby-cli]/lib/init-starter.js:343:5

  - create-cli.js:458
    [npm]/[gatsby-cli]/lib/create-cli.js:458:9

@turbodude
Copy link

Downgrading to Node v14.20.0 apparently fixes the issue.

@KevinRodrigues23
Copy link

KevinRodrigues23 commented Aug 2, 2022

Verifique o antivirus, e desabilitar a proteção das portas:

@Legion-God
Copy link

Legion-God commented Aug 26, 2022

For me, the issue was resolved by reducing the maxsockets as stated earlier, in the npm config.
To reduce maxsockets run the following command.
sudo npm config set maxsockets=5

default was maxsockets=15

@lorenzogrv
Copy link

I can confirm this is reproducible on unstable network connections with npm 8.19.1. It's easier to see the buggy behavior within a docker build.

I suggest @nlf and @npm team to reopen and set-up a test within network throttling in attempt to reproduce.

Reducing maxsockets with npm config set maxsockets=5 as suggested worked, but it feels slower than running npm ci within's host machine context with the same maxsockets config applied

Please let me know if I can help debugging/reproducing this.

@doyelese
Copy link

+1 to seeing this behaviour frequently in a docker environment

@rolias4031
Copy link

rolias4031 commented Apr 19, 2023

Im seeing this same timeout error. However, I've noticed that it only happens on my home wifi. If I use my iPhone's hotspot everything works blazingly fast. I don't have any proxies set and I have reset my home wifi. This also happens on my work Mac too. Home wifi === npm timout errors. Hotspot === fine.

I'm running Node v 20.0.0 and npm 9.6.4.

here's the output of my --loglevel verbose:

npm verb cli /Users/sailormetz/.nvm/versions/node/v20.0.0/bin/node /Users/sailormetz/.nvm/versions/node/v20.0.0/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm install
npm verb argv "install" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/sailormetz/.npm/_logs/2023-04-19T06_27_01_907Z-
npm verb logfile /Users/sailormetz/.npm/_logs/2023-04-19T06_27_01_907Z-debug-0.log
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-win32-x64-msvc
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-win32-ia32-msvc
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-win32-arm64-msvc
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-linux-x64-musl
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-linux-x64-gnu
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-linux-arm64-musl
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-linux-arm64-gnu
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-linux-arm-gnueabihf
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-freebsd-x64
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-darwin-x64
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-android-arm64
npm verb reify failed optional dependency /Users/sailormetz/Development/Web/metz-crypto-dashboard/node_modules/@next/swc-android-arm-eabi
npm verb audit error FetchError: request to https://registry.npmjs.org/-/npm/v1/security/audits/quick failed, reason: Socket connection timeout
npm verb audit error     at ClientRequest.<anonymous> (/Users/sailormetz/.nvm/versions/node/v20.0.0/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
npm verb audit error     at ClientRequest.emit (node:events:511:28)
npm verb audit error     at TLSSocket.socketErrorListener (node:_http_client:495:9)
npm verb audit error     at TLSSocket.emit (node:events:523:35)
npm verb audit error     at emitErrorNT (node:internal/streams/destroy:151:8)
npm verb audit error     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm verb audit error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm verb audit error  FetchError: request to https://registry.npmjs.org/-/npm/v1/security/audits/quick failed, reason: Socket connection timeout
npm verb audit error     at ClientRequest.<anonymous> (/Users/sailormetz/.nvm/versions/node/v20.0.0/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
npm verb audit error     at ClientRequest.emit (node:events:511:28)
npm verb audit error     at TLSSocket.socketErrorListener (node:_http_client:495:9)
npm verb audit error     at TLSSocket.emit (node:events:523:35)
npm verb audit error     at emitErrorNT (node:internal/streams/destroy:151:8)
npm verb audit error     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm verb audit error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
npm verb audit error   code: 'ERR_SOCKET_CONNECTION_TIMEOUT',
npm verb audit error   errno: 'ERR_SOCKET_CONNECTION_TIMEOUT',
npm verb audit error   type: 'system'
npm verb audit error }

@tobiaswendling
Copy link

I have the same issue as @rolias4031 described: Socket connection timeout on the home network but no problems with a hotspot. I updated npm and node to the latest version using nvm. Here's the error log:

1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Users\tobia\AppData\Roaming\nvm\v20.0.0\node_modules\npm\npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:E:\az GmbH Personalberatung\azgmbhpersonalberatung\wp-content\themes\azgmbhpersonalberatung\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\tobia\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 6ms
17 timing npm:load:configload Completed in 6ms
18 timing npm:load:mkdirpcache Completed in 1ms
19 timing npm:load:mkdirplogs Completed in 0ms
20 verbose title npm install react-google-recaptcha
21 verbose argv "install" "react-google-recaptcha" "--registry" "https://registry.npmjs.org" "--maxsockets"
22 timing npm:load:setTitle Completed in 1ms
23 timing config:load:flatten Completed in 1ms
24 timing npm:load:display Completed in 2ms
25 verbose logfile logs-max:10 dir:C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-
26 verbose logfile C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-debug-0.log
27 timing npm:load:logFile Completed in 5ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 16ms
31 timing arborist:ctor Completed in 1ms
32 silly logfile start cleaning logs, removing 2 files
33 timing idealTree:init Completed in 510ms
34 timing idealTree:userRequests Completed in 2ms
35 silly idealTree buildDeps
36 silly fetch manifest react-google-recaptcha@*
37 silly logfile done cleaning log files
38 timing arborist:ctor Completed in 0ms
39 silly placeDep ROOT react-google-recaptcha@ OK for:  want: *
40 timing idealTree:#root Completed in 88249ms
41 timing idealTree:node_modules/react-google-recaptcha Completed in 0ms
42 timing idealTree:buildDeps Completed in 88250ms
43 timing idealTree:fixDepFlags Completed in 5ms
44 timing idealTree Completed in 88769ms
45 timing command:install Completed in 88774ms
46 verbose type system
47 verbose stack FetchError: request to https://registry.npmjs.org/react-google-recaptcha failed, reason: Socket connection timeout
47 verbose stack     at ClientRequest.<anonymous> (C:\Users\tobia\AppData\Roaming\nvm\v20.0.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
47 verbose stack     at ClientRequest.emit (node:events:511:28)
47 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:495:9)
47 verbose stack     at TLSSocket.emit (node:events:523:35)
47 verbose stack     at emitErrorNT (node:internal/streams/destroy:151:8)
47 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
47 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:82:21)
47 verbose stack     at runNextTicks (node:internal/process/task_queues:64:3)
47 verbose stack     at process.processTimers (node:internal/timers:511:9)
48 verbose cwd E:\az GmbH Personalberatung\azgmbhpersonalberatung\wp-content\themes\azgmbhpersonalberatung
49 verbose Windows_NT 10.0.22621
50 verbose node v20.0.0
51 verbose npm  v9.6.4
52 error code ERR_SOCKET_CONNECTION_TIMEOUT
53 error errno ERR_SOCKET_CONNECTION_TIMEOUT
54 error request to https://registry.npmjs.org/react-google-recaptcha failed, reason: Socket connection timeout
55 verbose exit 1
56 timing npm Completed in 88808ms
57 verbose unfinished npm timer reify 1682593262951
58 verbose unfinished npm timer reify:loadTrees 1682593262954
59 verbose code 1
60 error A complete log of this run can be found in: C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-debug-0.log```

@rolias4031
Copy link

I have the same issue as @rolias4031 described: Socket connection timeout on the home network but no problems with a hotspot. I updated npm and node to the latest version using nvm. Here's the error log:


1 info using [email protected]

2 info using [email protected]

3 timing npm:load:whichnode Completed in 1ms

4 timing config:load:defaults Completed in 1ms

5 timing config:load:file:C:\Users\tobia\AppData\Roaming\nvm\v20.0.0\node_modules\npm\npmrc Completed in 0ms

6 timing config:load:builtin Completed in 0ms

7 timing config:load:cli Completed in 2ms

8 timing config:load:env Completed in 0ms

9 timing config:load:file:E:\az GmbH Personalberatung\azgmbhpersonalberatung\wp-content\themes\azgmbhpersonalberatung\.npmrc Completed in 0ms

10 timing config:load:project Completed in 1ms

11 timing config:load:file:C:\Users\tobia\.npmrc Completed in 0ms

12 timing config:load:user Completed in 0ms

13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 1ms

14 timing config:load:global Completed in 1ms

15 timing config:load:setEnvs Completed in 0ms

16 timing config:load Completed in 6ms

17 timing npm:load:configload Completed in 6ms

18 timing npm:load:mkdirpcache Completed in 1ms

19 timing npm:load:mkdirplogs Completed in 0ms

20 verbose title npm install react-google-recaptcha

21 verbose argv "install" "react-google-recaptcha" "--registry" "https://registry.npmjs.org" "--maxsockets"

22 timing npm:load:setTitle Completed in 1ms

23 timing config:load:flatten Completed in 1ms

24 timing npm:load:display Completed in 2ms

25 verbose logfile logs-max:10 dir:C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-

26 verbose logfile C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-debug-0.log

27 timing npm:load:logFile Completed in 5ms

28 timing npm:load:timers Completed in 0ms

29 timing npm:load:configScope Completed in 0ms

30 timing npm:load Completed in 16ms

31 timing arborist:ctor Completed in 1ms

32 silly logfile start cleaning logs, removing 2 files

33 timing idealTree:init Completed in 510ms

34 timing idealTree:userRequests Completed in 2ms

35 silly idealTree buildDeps

36 silly fetch manifest react-google-recaptcha@*

37 silly logfile done cleaning log files

38 timing arborist:ctor Completed in 0ms

39 silly placeDep ROOT react-google-recaptcha@ OK for:  want: *

40 timing idealTree:#root Completed in 88249ms

41 timing idealTree:node_modules/react-google-recaptcha Completed in 0ms

42 timing idealTree:buildDeps Completed in 88250ms

43 timing idealTree:fixDepFlags Completed in 5ms

44 timing idealTree Completed in 88769ms

45 timing command:install Completed in 88774ms

46 verbose type system

47 verbose stack FetchError: request to https://registry.npmjs.org/react-google-recaptcha failed, reason: Socket connection timeout

47 verbose stack     at ClientRequest.<anonymous> (C:\Users\tobia\AppData\Roaming\nvm\v20.0.0\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)

47 verbose stack     at ClientRequest.emit (node:events:511:28)

47 verbose stack     at TLSSocket.socketErrorListener (node:_http_client:495:9)

47 verbose stack     at TLSSocket.emit (node:events:523:35)

47 verbose stack     at emitErrorNT (node:internal/streams/destroy:151:8)

47 verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)

47 verbose stack     at processTicksAndRejections (node:internal/process/task_queues:82:21)

47 verbose stack     at runNextTicks (node:internal/process/task_queues:64:3)

47 verbose stack     at process.processTimers (node:internal/timers:511:9)

48 verbose cwd E:\az GmbH Personalberatung\azgmbhpersonalberatung\wp-content\themes\azgmbhpersonalberatung

49 verbose Windows_NT 10.0.22621

50 verbose node v20.0.0

51 verbose npm  v9.6.4

52 error code ERR_SOCKET_CONNECTION_TIMEOUT

53 error errno ERR_SOCKET_CONNECTION_TIMEOUT

54 error request to https://registry.npmjs.org/react-google-recaptcha failed, reason: Socket connection timeout

55 verbose exit 1

56 timing npm Completed in 88808ms

57 verbose unfinished npm timer reify 1682593262951

58 verbose unfinished npm timer reify:loadTrees 1682593262954

59 verbose code 1

60 error A complete log of this run can be found in: C:\Users\tobia\AppData\Local\npm-cache\_logs\2023-04-27T11_01_02_918Z-debug-0.log```


Hey @tobiaswendling this turned out to purely be a network issue for me. Using a VPN also solves the problem, and the issue went away within a few days.

I use Spectrum and live in TX, USA if that helps. I've also found Reddit threads unrelated to development/npm that talk about odd spectrum blockages.

@jay13jay
Copy link

jay13jay commented May 2, 2023

I had the same issues described above, and once I switched on one of my VPN clients, the issue went away.
I also live in Texas, USA, and use Spectrum internet (which is about to change, this isn't the first time their dumb service is blocking legitimate traffic for no discernable reason)

@larkarvin
Copy link

I've been using 8.8.8.8 when I've encountered this issue but I was able to successfully update when using 1.1.1.1

@zweyka
Copy link

zweyka commented Mar 25, 2024

In my case the problem was solved by increasing the RAM.
Was 1Gb. Now 3Gb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.