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

Опубликовано: 22 Март 2026
на канале: timeoutexpired
2,605
6

while creating new project in angular or while running below command
ng new projectname
i got error
| Installing packages (npm)...npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.np
mjs.org/css-loader: 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 settin
gs.
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\ADMIN\AppData\Local\npm-cache\_logs\2023-02-26T11_20_24_01
4Z-debug-0.log
x Package install failed, see above.
The Schematic workflow failed. See above.


to solve this issue
try to run following command
npm config set timeout 300000
and re-run ng new projectname

if you got error while running command npm config set timeout 300000
npm ERR! `timeout` is not a valid npm option
then try another command as
npm config set fetch-retry-maxtimeout 60000
and re-run ng new projectname