ui icon indicating copy to clipboard operation
ui copied to clipboard

Failed to fetch styles from registry

Open MR-Khaleghi opened this issue 2 years ago • 26 comments

I'm getting this error while trying to install shadcn command: npx shadcn-ui@latest init

error: FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: read ECONNRESET at ClientRequest. (file:///C:/Users/star/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:502:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET', erroredSysCall: 'read' } Failed to fetch styles from registry.

MR-Khaleghi avatar Aug 28 '23 08:08 MR-Khaleghi

It seems more like a network issue ig, did u try installing again later?

dev-shetty avatar Aug 28 '23 10:08 dev-shetty

I'm not sure it's from network.becuase there was not any network problem to open this issue on github and after 30 minutes I could install from the same network. I guess there is some issue with shadcn.

MR-Khaleghi avatar Aug 28 '23 11:08 MR-Khaleghi

got this issue how to solve

zf0x00 avatar Nov 27 '23 16:11 zf0x00

I have the same problem

PS D:\Projects\TehService> npx shadcn-ui@latest init FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: at ClientRequest. (file:///C:/Users/OrehovPY/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT', erroredSysCall: undefined } Failed to fetch styles from registry.

Pavelsiba avatar Dec 13 '23 10:12 Pavelsiba

the same problem. I tried it with many different network on different system, but encountering the same problem!!!

AbbasHarati avatar Dec 18 '23 18:12 AbbasHarati

I also have the same issuer

GeorgiyIakunenko avatar Dec 21 '23 14:12 GeorgiyIakunenko

The same problem for me .

PS C:\projects\next\shadcdntest> npx shadcn-ui@latest init FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: connect ETIMEDOUT 76.76.21.123:443 at ClientRequest. (file:///C:/projects/next/shadcdntest/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:502:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT', erroredSysCall: 'connect' } Failed to fetch styles from registry.

radvanCZ avatar Jan 08 '24 16:01 radvanCZ

I

I also have the same issuer

Fixed it, problem was in http proxy certs

GeorgiyIakunenko avatar Jan 08 '24 16:01 GeorgiyIakunenko

I solved it. NPX does not use the npm configuration, so my proxy settings were ignored. I had to set local user variables in my PowerShell environment, which was the main problem.

To resolve this, I used the following commands in PowerShell:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://server:port/' New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://server:port/' This enabled NPX to connect to the shadcn repository.

Then, I encountered an issue with an untrusted certificate. I resolved this by adding the shadcn certificate to the root certificates in the certmgr.msc utility for Windows.

radvanCZ avatar Jan 11 '24 11:01 radvanCZ

I

I also have the same issuer

Fixed it, problem was in http proxy certs

how do it?

chyun1006 avatar Jan 13 '24 03:01 chyun1006

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'https://ui.shadcn.com/'

I encountered the same problem, tried your solution and the problem was fixed. Thank you

I solved it. NPX does not use the npm configuration, so my proxy settings were ignored. I had to set local user variables in my PowerShell environment, which was the main problem.

To resolve this, I used the following commands in PowerShell:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://server:port/' New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://server:port/' This enabled NPX to connect to the shadcn repository.

Then, I encountered an issue with an untrusted certificate. I resolved this by adding the shadcn certificate to the root certificates in the certmgr.msc utility for Windows.

onemahmoudadel avatar Jan 13 '24 10:01 onemahmoudadel

Your region is probably blocked by shadcn. I also had this problem and changed the proxy and was able to install it. If you use a proxy, test different regions.

alipalvane avatar Feb 02 '24 10:02 alipalvane

I solved it. NPX does not use the npm configuration, so my proxy settings were ignored. I had to set local user variables in my PowerShell environment, which was the main problem.

To resolve this, I used the following commands in PowerShell:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://server:port/' New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://server:port/' This enabled NPX to connect to the shadcn repository.

Then, I encountered an issue with an untrusted certificate. I resolved this by adding the shadcn certificate to the root certificates in the certmgr.msc utility for Windows.

really helped

RowdyKGZ avatar Mar 01 '24 11:03 RowdyKGZ

I solved it. NPX does not use the npm configuration, so my proxy settings were ignored. I had to set local user variables in my PowerShell environment, which was the main problem.

To resolve this, I used the following commands in PowerShell:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://server:port/' New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://server:port/' This enabled NPX to connect to the shadcn repository.

Then, I encountered an issue with an untrusted certificate. I resolved this by adding the shadcn certificate to the root certificates in the certmgr.msc utility for Windows.

Hello there. I'm having this same issue on Mac. Do you have any idea how I could fix this on Mac?

Josh-Savvy avatar Apr 08 '24 22:04 Josh-Savvy

I am also facing the same error. How to fixed this issue? FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: connect ETIMEDOUT 76.76.21.164:443 at ClientRequest. (file:///C:/Users/anujk/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:526:28) at TLSSocket.socketErrorListener (node:_http_client:442:9) at TLSSocket.emit (node:events:526:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT', erroredSysCall: 'connect' } Failed to fetch styles from registry.

anujgupta5686 avatar Apr 14 '24 01:04 anujgupta5686

My operating environment is Windows. I used Google to look up the IP address for https://www.shadcn-vue.com/registry/styles/index.json and found it to be 104.21.17.226 . and I edited the hosts file on my Windows computer, adding the line:

104.21.17.226 www.shadcn-vue.com

With this addition, the configuration takes effect locally for me; however, some Windows devices might require a restart for the changes in the hosts file to be applied.

Side note: As a Chinese person, dealing with these sorts of network issues can often be quite draining.

Hope you can enjoy it !!!

wuqianrui avatar May 01 '24 02:05 wuqianrui

I encountered a similar issue where I couldn't even access the shadcn website. I set my region settings to the correct location, and the problem was resolved. Previously it was set to the United States

Shazzad998 avatar May 01 '24 15:05 Shazzad998

I encountered the same issue in NextJS 14 version, And resolved it by opening a new terminal and again running the command: npx shadcn-ui@latest init in a new terminal and it worked!

deepakA18 avatar May 06 '24 11:05 deepakA18

I'm encountering the exact same thing running npx shadcn-ui@latest init:

FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: read ECONNRESET
    at ClientRequest.<anonymous> (file:///C:/Users/c8m9s/AppData/Local/npm-cache/_npx/2c1ae577c581653c/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:519:28)
    at TLSSocket.socketErrorListener (node:_http_client:492:9)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  erroredSysCall: 'read'
}

I tried the Powershell proxy update suggested above:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://localhost:3000/'
New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://localhost:3000/'

This didn't resolve the issue.

AllThingsSmitty avatar May 21 '24 12:05 AllThingsSmitty

i am having the same issue currently how do i go about it? npx shadcn-ui@latest add card FetchError: request to https://ui.shadcn.com/registry/index.json failed, reason: read ECONNRESET at ClientRequest. (file:///C:/Users/HP/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:518:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET', erroredSysCall: 'read' } Failed to fetch components from registry.

Falasefemi2 avatar May 21 '24 18:05 Falasefemi2

@Falasefemi2 Try by killing the terminal and open the new terminal and enter the command again! Don't know how but, this worked for me twice

deepakA18 avatar May 22 '24 01:05 deepakA18

FetchError: request to https://ui.shadcn.com/registry/index.json failed, reason: write EPROTO 00E6541201000000:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:ssl/record/methods/tlsany_meth.c:81:

at ClientRequest.<anonymous> (file:///Users/vikash/Desktop/bloggr/frontend/node_modules/node-fetch/src/index.js:108:11)
at ClientRequest.emit (node:events:519:28)
at TLSSocket.socketErrorListener (node:_http_client:500:9)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {

type: 'system', errno: 'EPROTO', code: 'EPROTO', erroredSysCall: 'write' } Failed to fetch components from registry. getting this error on my mac.

Vikashrock45 avatar May 24 '24 10:05 Vikashrock45

Add the following two lines to the Windows hosts file and restart your computer

104.21.17.226 www.shadcn-vue.com
76.76.21.9 www.ui.shadcn.com

youwei997 avatar Jun 02 '24 19:06 youwei997

this is because the network you are using has blocked shadcn. I was using my company network. Got this issue, realized then.

mayasingh5 avatar Jun 17 '24 04:06 mayasingh5

I solved it. NPX does not use the npm configuration, so my proxy settings were ignored. I had to set local user variables in my PowerShell environment, which was the main problem.

To resolve this, I used the following commands in PowerShell:

New-Item -Path 'Env:' -Name 'HTTP_PROXY' -Value 'http://server:port/' New-Item -Path 'Env:' -Name 'HTTPS_PROXY' -Value 'http://server:port/' This enabled NPX to connect to the shadcn repository.

Then, I encountered an issue with an untrusted certificate. I resolved this by adding the shadcn certificate to the root certificates in the certmgr.msc utility for Windows.

Thank you for your answer. Please can you provide any information about how you added shadcn certificate to the certmgr.msc utility

ayomide-yoke avatar Jun 25 '24 09:06 ayomide-yoke

Use a VPN while installing shadcn ui .

Samiha13 avatar Jul 04 '24 14:07 Samiha13

I deleted my 'node modules' folder, pnpm install it again and finally run the command: npx shadcn-vue@latest init it worked for me !

mahima98 avatar Jul 16 '24 12:07 mahima98

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Aug 08 '24 23:08 shadcn