FG
šŸ› ļø Developer ToolsMicrosoft

Installing packages (npm)...npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT

Freshabout 4 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Is there an existing issue for this? - [X] I have searched the existing issues This issue exists in the latest npm version - [X] I am using the latest npm Current Behavior npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/postcss-import: 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! /home/bentex/.npm/_logs/2022-03-11T08_41_06_921Z-debug-0.log āœ– Package install failed, see above. The Schematic workflow failed. See above. Expected Behavior I expect to create a new angular project using the command ng new but seems theres a socket timeout each time i try Steps To Reproduce 1. In this environment... linux distro parrotOs 2. With this config... 3. Run '...' ng new .. 4. See error... Environment npm -v 8.3.1 $node -v v17.4.0 "user" config from /home/bentex/.npmrc legacy-peer-deps = true ; node bin location = /home/bentex/.nvm/versions/node/v17.4.0/bin/node

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
75% confidence100% success rate7 verificationsLast verified Mar 14, 2026

Solution: Installing packages (npm)...npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT

Low Risk

I just had this issue and it helped changing timeouts: npm config set fetch-retry-mintimeout 20000 npm config set fetch-retry-maxtimeout 120000

75

Trust Score

7 verifications

100% success
  1. 1

    I just had this issue and it helped changing timeouts:

    I just had this issue and it helped changing timeouts:

  2. 2

    npm config set fetch-retry-mintimeout 20000

    npm config set fetch-retry-maxtimeout 120000

Validation

Resolved in npm/cli GitHub issue #4553. Community reactions: 42 upvotes.

Verification Summary

Worked: 7
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

npmpackage-managernodejsrelease-8.xbugneeds-triage