Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
captainyufei opened this issue Jun 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@captainyufei
Copy link

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

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@captainyufei captainyufei added the bug Something isn't working label Jun 24, 2024
@Boby900
Copy link

Boby900 commented Jun 26, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants