shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
69.08k stars 4.1k forks source link

[bug]: The ‘npx shadcn-ui@latest init’ cannot be executed on the company network. How can I init it offline? #4085

Open captainyufei opened 2 months ago

captainyufei commented 2 months ago

Describe the bug

Describe the bug Tried installing with the command, "npx shadcn-ui@latest init". But it keeps throwing the following error.

FetchError: request to https://ui.shadcn.com/registry/styles/index.json failed, reason: connect ECONNREFUSED 76.76.21.93:443 at ClientRequest. (file:///Users/equallyai/.npm/_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:122:3) at processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT', erroredSysCall: 'undefined' } Failed to fetch styles from registry.

Affected component/components

None

How to reproduce

npx shadcn-ui@latest init

Codesandbox/StackBlitz link

No response

Logs

None

System Info

wind11 node:v20.11

Before submitting

Boby900 commented 2 months ago

@captainyufei I tried asking ChatGPT, you could follow these, and all the source code is available so you could try to self-host shadcn if you want to. The solution involves pre-downloading the necessary files and dependencies in an environment with internet access, transferring them to the offline environment, and setting up the project locally I guess it's not a bug specific to Shadcn. It would have been better if you had asked in the discussions section.

swapnil9898 commented 1 month ago

The issue was resolved by the system administrator, who granted me full access and added the necessary certificate. After that, the issue was resolved.

Gitcolon1234 commented 1 week ago

The issue was resolved by the system administrator, who granted me full access and added the necessary certificate. After that, the issue was resolved.

can you tell me about the necessary process