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
74.17k stars 4.58k forks source link

CLI - Fetch Error when requesting neutral base color #1412

Closed ideakaran closed 4 months ago

ideakaran commented 1 year ago

I have a next.js app and I am trying to use shadcn-ui in my app. I hit the command "npx shadcn-ui@latest init" in the terminal and answered all the configuration question but I am getting the following error.

npx shadcn-ui@latest init √ Would you like to use TypeScript (recommended)? ... no / yes √ Which style would you like to use? » New York √ Which color would you like to use as base color? » Neutral √ Where is your global CSS file? ... app/globals.css √ Would you like to use CSS variables for colors? ... no / yes √ Where is your tailwind.config.js located? ... tailwind.config.js √ Configure the import alias for components: ... @/components √ Configure the import alias for utils: ... @/lib/utils √ Are you using React Server Components? ... no / yes √ Write configuration to components.json. Proceed? ... yes

✔ Writing components.json... ⠸ Initializing project...FetchError: request to https://ui.shadcn.com/registry/colors/neutral.json failed, reason: connect ETIMEDOUT 76.76.21.61:443 at ClientRequest. (file:///C:/Users/FullStack/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:501: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: 'connect' } Failed to fetch base color from registry.

If I open the url ("https://ui.shadcn.com/registry/colors/neutral.json"), in my browser, then I get the json configuration response.

My Operating System is Windows 11 and next is"13.4.19".

shadcn commented 1 year ago

Hmm is this still happening for you?

RenzoBA commented 1 year ago

Maybe this will help you... currently Next.js creates the tailwind.config.ts file if you choose TS when creating your project, but shadcn-ui keeps creating tailwind.config.js when you implement it. So you have 2 files with different extensions.

ideakaran commented 1 year ago

Now, it's working. I don't know why it behaved that way but today it is working.

toannguyen3105 commented 1 year ago

I got the same

ideakaran commented 1 year ago

Reopened this issue as, still facing smiliar issue. This time I am getting following error

npx shadcn-ui@latest add √ Which components would you like to add? » accordion, alert, alert-dialog, aspect-ratio, avatar, badge, button, calendar, card, checkbox, collapsible, command, context-menu, dialog, dropdown-menu, form, hover-card, input, label, menubar, navigation-menu, popover, progress, radio-group, scroll-area, select, separator, sheet, skeleton, slider, switch, table, tabs, textarea, toast, toggle, tooltip FetchError: request to https://ui.shadcn.com/registry/styles/new-york/card.json failed, reason: connect ETIMEDOUT 76.76.21.22:443 at ClientRequest. (file:///C:/Users/FullStack/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:501: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: 'connect' } Failed to fetch tree from registry.

However, If i hit the url(https://ui.shadcn.com/registry/styles/new-york/card.json) in browser, I get the response. So, not really sure why it's saying ETIMEDOUT.

shadcn commented 1 year ago

Let me see if I can reproduce.

coderismaila commented 1 year ago

Had same issue. Restarted my system and all seems fine

kalbaevv commented 1 year ago

@coderismaila i did the same and it also worked fine. Thanks!

profcoconut commented 1 year ago

What works for me: npx shadcn-ui@latest init

My issue is caused by "baseColor": "blue", which was changed from "slate", in components.json'. Hope it helps.

Ngash01 commented 1 year ago

@coderismaila yes worked for me too. Restarting actually solves the error.

faeztgh commented 12 months ago

This is caused by a mismatch between your theme colours and the colour that is defined in components.json file.

vidzshan commented 8 months ago

npx shadcn-ui@latest init

√ Which color would you like to use as base color? » Slate √ Would you like to use CSS variables for colors? ... no / yes

✔ Writing components.json... ✔ Initializing project... ⠹ Installing dependencies...Command failed with exit code 1: npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react npm ERR! code ERR_SOCKET_CONNECTION_TIMEOUT npm ERR! errno ERR_SOCKET_CONNECTION_TIMEOUT npm ERR! request to https://registry.npmjs.org/tailwindcss-animate failed, reason: Socket connection timeout

npm ERR! A complete log of this run can be found in: C:\Users\LENOVO\AppData\Local\npm-cache_logs\2024-03-10T16_54_06_305Z-debug-0.log

shadcn commented 4 months ago

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.