[bug]: request to https://ui.shadcn.com/r/styles/index.json failed
Describe the bug
While trying to exec shadn@latest init, the index.json is timing out:
npx shadcn@latest init
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.
request to https://ui.shadcn.com/r/styles/index.json failed, reason: connect ETIMEDOUT 76.76.21.164:443
I'm able to acccess the json via web browser:
{
"name": "new-york",
"label": "New York"
},
{
"name": "default",
"label": "Default"
}
]
Affected component/components
core
How to reproduce
npx shadcn@latest init
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
macOS Sonoma
Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Maybe it's something with Vercel DNS.
ping ui.shadcn.com
PING cname.vercel-dns.com (76.76.21.164): 56 data bytes
Request timeout for icmp_seq 0
Now pinging correctly:
ping ui.shadcn.com
PING cname.vercel-dns.com (76.76.21.61): 56 data bytes
64 bytes from 76.76.21.61: icmp_seq=0 ttl=243 time=11.711 ms
64 bytes from 76.76.21.61: icmp_seq=1 ttl=243 time=14.729 ms
64 bytes from 76.76.21.61: icmp_seq=2 ttl=243 time=11.605 ms
@luco 怎么解决的呢?
please how can i go around this issue, because i have been trying to install nextjs with shadcn but i keep getting this error.
It's something with Vercel DNS I think.
It's back lol. Same timeout:
PING 76.76.21.164 (76.76.21.164): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
Request timeout for icmp_seq 8
Request timeout for icmp_seq 9
Request timeout for icmp_seq 10
I have the same problem
➜ front git:(main) ✗ npx shadcn@latest add form
⠧ Checking registry.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.
request to https://ui.shadcn.com/r/index.json failed, reason:
It happen with my company network, they are using proxy for the security reason, when i tried with mobile network in my personal laptop, it worked, but not working in all the PC in my company.
Solution: For those who using proxy, write this in CMD, where your project is open
set http_proxy=http://your.proxy:5050
set https_proxy=http://your.proxy:5050
set http.proxyStrictSSL=false
set NODE_TLS_REJECT_UNAUTHORIZED=0
Now you can exec = npx shadn@latest init
I was able to resolve the issue by turning on the VPN and changing the location to the US
I was able to resolve the issue by turning on the VPN and changing the location to the US
This doesn't work for me, is there any other solution?
I had the same problem, but I switched my computer network to a phone hotspot and the installation went fine
I tried several method but failed:
- Set a npm proxy and https-proxy
- Set a system HTTP_PROXY and HTTPS_PROXY
- Set a registry for npm
- Enable and disable the TUN mode in my proxy app
However, when I upgrade the Node.js installation on Windows, the problem didn't exist any more.
So there are my problems and the solutions:
- npm connection unstable: Try using a proxy and a registry
- ui.shadcn.com won't connect via https: Try upgrading your Node.js to a newer version (eg. the latest of lts)
Issue solved! Here's a step-by-step solution that worked for me:
-
Environment Requirements:
- Node.js >= v18.17.0
- Stable proxy configuration
-
Key Steps:
# 1. Verify network access curl https://ui.shadcn.com/r/index.json # Should return 200 OK # 2. Minimize proxy settings (PowerShell) $env:HTTPS_PROXY="http://127.0.0.1:7890" # Replace with your proxy port # 3. Run installation with global flag npx --location=global shadcn@latest init -
Proxy Tool Settings (if using Clash):
- TUN mode: OFF
- Allow LAN: ON
- Ensure proxy is running properly
The key was to simplify the environment configuration and use the --location=global flag with npx. This resolved both the ETIMEDOUT and TLS connection issues.
Hope this helps others facing similar issues! 🚀
curl https://ui.shadcn.com/r/index.json
curl https://ui.shadcn.com/r/index.json
You may use a proxy first.
I have a new idea: use pnpx instead of npx to speed up installation and get rid of Internet errors.
Most times the issue is your internet IP address. What I did was I changed to a different IP. Changing your IP can be in many factors:
- Changing your network provider
- Changing to a new IP like did which was moving to a mifi
- Changing your network proxy(I didn't do this since two worked)
shit ,after my attempts, I hava found an avniable host address so far .please configure you hosts file to add this mapping 76.76.21.241 cname.vercel-dns.com . before the configuration please ping it to ensure the network is normal,in the configuration . if you find other host addresses .please share it
问题解决了!以下是对我有用的分步解决方案:
环境要求:
- Node.js >= v18.17.0
- 稳定的代理配置
关键步骤:
# 1. Verify network access curl https://ui.shadcn.com/r/index.json # Should return 200 OK # 2. Minimize proxy settings (PowerShell) $env:HTTPS_PROXY="http://127.0.0.1:7890" # Replace with your proxy port # 3. Run installation with global flag npx --location=global shadcn@latest init代理工具设置(如果使用 Clash):
- TUN 模式:关闭
- 允许 LAN:开启
- 确保代理正常运行
关键是简化环境配置并将
--location=global标志与 npx 一起使用。这解决了 ETIMEDOUT 和 TLS 连接问题。希望这能帮助其他面临类似问题的人!🚀
问题解决了!以下是对我有用的分步解决方案:
环境要求:
- Node.js >= v18.17.0
- 稳定的代理配置
关键步骤:
# 1. Verify network access curl https://ui.shadcn.com/r/index.json # Should return 200 OK # 2. Minimize proxy settings (PowerShell) $env:HTTPS_PROXY="http://127.0.0.1:7890" # Replace with your proxy port # 3. Run installation with global flag npx --location=global shadcn@latest init代理工具设置(如果使用 Clash):
- TUN 模式:关闭
- 允许 LAN:开启
- 确保代理正常运行
关键是简化环境配置并将
--location=global标志与 npx 一起使用。这解决了 ETIMEDOUT 和 TLS 连接问题。希望这能帮助其他面临类似问题的人!🚀
感谢。It works!
@luco 怎么解决的呢?
别开代理就行了
I resolved this by turning off my VPN. Maybe the IP I was using was blocked?
Also was fixed just by turning off my VPN
Why is my cmd pinging to different IP than yours?
C:\Windows\System32>ping ui.shadcn.com
Pinging cname.vercel-dns.com [66.33.60.129] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 66.33.60.129:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
I solve it.
- ping ui.shacn.com you have ip not timeout same ping ui.shadcn.com PING cname.vercel-dns.com (76.76.21.98) 56(84) bytes of data. 64 bytes from 76.76.21.98: icmp_seq=1 ttl=245 time=31.8 ms
- Get IP add to /etc/hosts file 76.76.21.98 ui.shadcn.com
Then try to run npx shadcn@latest init
my problem is using 1.1.1.1 dns config. Remove it fixed for me (change to 8.8.8.8)
You guys can try using node v20. It's work for me!
我也遇到了问题,但是在之前是好的,就在昨天,他出现了这种问题
我也遇到了问题,但是在之前是好的,就在昨天,他出现了这种问题
我查询了国外版的文档,在安装组件时,使用pnpm dlx shadcn@latest add button 而不是国内版v4文档下的pnpm dlx shadcn@canary button 解决了这个问题
Same issues and resolved by VPN 1111.