ui: CLI - Failed to fetch tree from registry - ERR_SOCKET_CONNECTION_TIMEOUT
I was following the documentation at https://ui.shadcn.com/docs/installation. After initializing the components.json with npx shadcn-ui@latest init I ran npx shadcn-ui@latest add and selected all components. It returns the error: “Failed to fetch tree from registry.” - ERR_SOCKET_CONNECTION_TIMEOUT.
Using the command with a component npx shadcn-ui@latest add avatar does only work for some components, for others like “avatar”, “command”, “toggle” I get the same error.
I tried style: default and style: new-york.
Tried commands:
npx shadcn-ui@latest add (select all components)
npx shadcn-ui@latest add avatar
npx shadcn-ui@latest add avatar --overwrite
npx shadcn-ui@latest add avatar, ...
Error:
FetchError: request to https://ui.shadcn.com/registry/styles/new-york/avatar.json failed, reason: Socket connection timeout
at ClientRequest.<anonymous> (file:///C:/Users/matteagle95/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11)
at ClientRequest.emit (node:events:511:28)
at TLSSocket.socketErrorListener (node:_http_client:495:9)
at TLSSocket.emit (node:events:511: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: 'ERR_SOCKET_CONNECTION_TIMEOUT',
code: 'ERR_SOCKET_CONNECTION_TIMEOUT',
erroredSysCall: undefined
}
Failed to fetch tree from registry.
OS/Project: OS: Windows 10 NextJS: 13.4.1
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 27 (3 by maintainers)
you can either a vpn or change your vpn ( in my case windscribe worked ), or you can just install the packages manually, the instructions are on their documents.
My operating environment is Windows. I used Google to look up the IP address for
https://www.shadcn-vue.com/registry/styles/index.jsonand found it to be104.21.17.226. and I edited the hosts file on my Windows computer, adding the line: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.
same here. Sometimes it works, and sometimes it fails
hi everybody,I also have the same bug, what is your suggestion for solving problem.