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]: Can't install shadcn #5880

Open
2 tasks done
Happiesamuel opened this issue Nov 20, 2024 · 4 comments
Open
2 tasks done

[bug]: Can't install shadcn #5880

Happiesamuel opened this issue Nov 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Happiesamuel
Copy link

Describe the bug

                          npx shadcn@latest init -d

C:\Users\Hs\Documents\sam>
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.js
✔ Updating src\app\globals.css
⠋ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with UNKNOWN: yarn add tailwindcss-animate class-variance-authority lucide-react clsx tailwind-merge
spawn UNKNOWN

Affected component/components

the component itself

How to reproduce

                          npx shadcn@latest init -d

C:\Users\Hs\Documents\sam>
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.js
✔ Updating src\app\globals.css
⠋ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with UNKNOWN: yarn add tailwindcss-animate class-variance-authority lucide-react clsx tailwind-merge
spawn UNKNOWN

Codesandbox/StackBlitz link

No response

Logs

npx shadcn@latest init -d
>> C:\Users\Hs\Documents\sam>
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.js
✔ Updating src\app\globals.css
⠋ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with UNKNOWN: yarn add tailwindcss-animate class-variance-authority lucide-react clsx tailwind-merge
spawn UNKNOWN

System Info

npx shadcn@latest init -d
>> C:\Users\Hs\Documents\sam>
✔ Preflight checks.
✔ Verifying framework. Found Next.js.
✔ Validating Tailwind CSS.
✔ Validating import alias.
✔ Writing components.json.
✔ Checking registry.
✔ Updating tailwind.config.js
✔ Updating src\app\globals.css
⠋ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with UNKNOWN: yarn add tailwindcss-animate class-variance-authority lucide-react clsx tailwind-merge
spawn UNKNOWN

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@Happiesamuel Happiesamuel added the bug Something isn't working label Nov 20, 2024
@antoinefamibelle
Copy link

Hi there! 🌟

Could you please provide some information such as your Node version and the operating system you are using? 💻

Thank you.

@Happiesamuel
Copy link
Author

Happiesamuel commented Nov 20, 2024 via email

@ChandanJal
Copy link

Same issue

pnpm dlx shadcn@latest add sidebar
Packages: +170
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 170, reused 170, downloaded 0, added 170, done
✔ Checking registry.
✔ Updating tailwind.config.ts
✔ Updating app\globals.css
⠸ Installing dependencies.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: pnpm add @radix-ui/react-slot class-variance-authority lucide-react @radix-ui/react-separator @radix-ui/react-dialog @radix-ui/react-tooltip
 WARN  Moving @hookform/resolvers that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving class-variance-authority that was installed by a different package manager to "node_modules/.ignored"
 WARN  Moving next that was installed by a different package manager to "node_modules/.ignored"
 EPERM  EPERM: operation not permitted, rename 'D:\....\node_modules\next' -> 'D:\....\node_modules\.ignored\next 

@CHampppppppp
Copy link

~

Error replacing tree: The children of the old and new trees were expected to have the same count (6:53).

-- Details --
Path: /var/folders/8m/6p32rcb53xnfdspb_1r2g0_w0000gn/T/shadcn-jsr4FM/shadcn-tailwind.config.ts
Text: "... font-semibold text-accent-2": {},\n\t\t\t\t},\n\t\t\t});\n\t\t}),\n require("tailwindcss-animate")\n ],\n\ttheme: {\n \textend: {\n \t\tcolors: {\n \t\t\taccent: {\n \t\t\t\tDEFAULT: 'hsl(var(--accent))',\n \t\t\t\tforeground: 'hsl(var(--accent-foreground))'\n \t\t\t},\n \t\t\t'accent-2': 'hsl(var(--theme-accent-2) / )',\n \t\t\tbgColor: 'hsl(var(--theme-bg) / )',\n \t\t\tlink: 'hsl(var(--theme-link) / )',\n \t\t\tquote: 'hsl(var(--theme-quote) / )',\n \t\t\ttextColor: 'hsl(var(--theme-text) / )',\n \t\t\tbackground: 'hsl(var(--background))',\n \t\t\tforeground: 'hsl(var(--foreground))',\n \t\t\tcard: {\n \t\t\t\tDEFAULT: 'hsl(var(--card))',\n \t\t\t\tforeground: 'hsl(var(--card-foreground))'\n \t\t\t},\n \t\t\tpopover: {\n \t\t\t\tDEFAULT: 'hsl(var(--popover))',\n \t\t\t\tforeground: 'hsl(var(--popover-foreground))'\n \t\t\t},\n \t\t\tprimary: {\n \t\t\t\tDEFAULT: 'hsl(var(--primary))',\n \t\t\t\tforeground: 'hsl(var(--primary-foreground))'\n \t\t\t},\n \t\t\tsecondary: {\n \t\t\t\tDEFAULT: 'hsl(var(--secondary))',\n \t\t\t\tforeground: 'hsl(var(--secondary-foreground))'\n \t\t\t},\n \t\t\tmuted: {\n \t\t\t\tDEFAULT: 'hsl(var(--muted))',\n \t\t\t\tforeground: 'hsl(var(--muted-foreground))'\n \t\t\t},\n \t\t\tdestructive: {\n \t\t\t\tDEFAULT: 'hsl(var(--destructive))',\n \t\t\t\tforeground: 'hsl(var(--destructive-foreground))'\n \t\t\t},\n \t\t\tborder: 'hsl(var(--border))',\n \t\t\tinput: 'hsl(var(--input))',\n \t\t\tring: 'hsl(var(--ring))',\n \t\t\tchart: {\n \t\t\t\t'1': 'hsl(var(--chart-1))',\n \t\t\t\t'2': 'hsl(var(--chart-2))',\n \t\t\t\t'3': 'hsl(var(--chart-3))',\n \t\t\t\t'4': 'hsl(var(--chart-4))',\n \t\t\t\t'5': 'hsl(var(--chart-5))'\n \t\t\t}\n \t\t},\n \t\tfontFamily: {\n \t\t\tsans: [...fontFamily.sans],\n \t\t\tserif: [...fontFamily.serif]\n \t\t},\n \t\ttransitionProperty: {\n \t\t\theight: 'height'\n \t\t},\n \t\ttypography: '(theme) => ({\n\t\t\t\tDEFAULT: {\n\t\t\t\t\tcss: {\n\t\t\t\t\t\ta: {\n\t\t\t\t\t\t\t"@apply cactus-link": "",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tblockquote: {\n\t\t\t\t\t\t\tborderLeftWidth: "0",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcode: {\n\t\t\t\t\t\t\tborder: "1px dotted #666",\n\t\t\t\t\t\t\tborderRadius: "2px",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tkbd: {\n\t\t\t\t\t\t\t"@apply dark:bg-textColor": "",\n\t\t\t\t\t\t},\n\t\t\t\t\t\thr: {\n\t\t\t\t\t\t\tborderTopStyle: "dashed",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstrong: {\n\t\t\t\t\t\t\tfontWeight: "700",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsup: {\n\t\t\t\t\t\t\t"@apply ms-0.5": "",\n\t\t\t\t\t\t\ta: {\n\t\t\t\t\t\t\t\t"&:after": {\n\t\t\t\t\t\t\t\t\tcontent: "']',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tcontent: "\[',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t"&:hover": {\n\t\t\t\t\t\t\t\t\t"@apply text-link no-underline bg-none": "",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t"@apply bg-none": "",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t/* Table /\n\t\t\t\t\t\t"tbody tr": {\n\t\t\t\t\t\t\tborderBottomWidth: "none",\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttfoot: {\n\t\t\t\t\t\t\tborderTop: "1px dashed #666",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthead: {\n\t\t\t\t\t\t\tborderBottomWidth: "none",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t"thead th": {\n\t\t\t\t\t\t\tborderBottom: "1px dashed #666",\n\t\t\t\t\t\t\tfontWeight: "700",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'th[align="center"], td[align="center"]': {\n\t\t\t\t\t\t\t"text-align": "center",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'th[align="right"], td[align="right"]': {\n\t\t\t\t\t\t\t"text-align": "right",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'th[align="left"], td[align="left"]': {\n\t\t\t\t\t\t\t"text-align": "left",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t/ Admonitions/Aside */\n\t\t\t\t\t\t".aside": {\n\t\t\t\t\t\t\t"--admonition-color": "var(--tw-prose-quotes)",\n\t\t\t\t\t\t\t"@apply my-4 py-4 ps-4 border-s-2 border-[--admonition-color]": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"@apply font-bold text-base flex items-center gap-2 my-0 capitalize text-[--admonition-color]":\n\t\t\t\t\t\t\t\t\t"",\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\t"@apply inline-block shrink-0 overflow-visible h-4 w-4 align-middle content-['] bg-[--admonition-color]":\n\t\t\t\t\t\t\t\t\t\t"",\n\t\t\t\t\t\t\t\t\t"mask-size": "contain",\n\t\t\t\t\t\t\t\t\t"mask-position": "center",\n\t\t\t\t\t\t\t\t\t"mask-repeat": "no-repeat",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t".aside-content": {\n\t\t\t\t\t\t\t\t"> :last-child": {\n\t\t\t\t\t\t\t\t\t"@apply mb-0": "",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t".aside.aside-note": {\n\t\t\t\t\t\t\t"--admonition-color": theme("colors.blue.400"),\n\t\t\t\t\t\t\t"@apply bg-blue-400/5": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tmaskImage: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath fill='var(--admonitions-color-tip)' d='M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'%3E%3C/path%3E%3C/svg%3E\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t".aside.aside-tip": {\n\t\t\t\t\t\t\t"--admonition-color": theme("colors.lime.500"),\n\t\t\t\t\t\t\t"@apply bg-lime-500/5": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tmaskImage: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z'%3E%3C/path%3E%3C/svg%3E\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t".aside.aside-important": {\n\t\t\t\t\t\t\t"--admonition-color": theme("colors.purple.400"),\n\t\t\t\t\t\t\t"@apply bg-purple-400/5": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tmaskImage: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'%3E%3C/path%3E%3C/svg%3E\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t".aside.aside-warning": {\n\t\t\t\t\t\t\t"--admonition-color": theme("colors.orange.400"),\n\t\t\t\t\t\t\t"@apply bg-orange-400/5": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tmaskImage: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'%3E%3C/path%3E%3C/svg%3E\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t".aside.aside-caution": {\n\t\t\t\t\t\t\t"--admonition-color": theme("colors.red.500"),\n\t\t\t\t\t\t\t"@apply bg-red-500/5": "",\n\t\t\t\t\t\t\t".aside-title": {\n\t\t\t\t\t\t\t\t"&:before": {\n\t\t\t\t\t\t\t\t\tmaskImage: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z'%3E%3C/path%3E%3C/svg%3E\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tcactus: {\n\t\t\t\t\tcss: {\n\t\t\t\t\t\t"--tw-prose-body": theme("colors.textColor / 1"),\n\t\t\t\t\t\t"--tw-prose-bold": theme("colors.textColor / 1"),\n\t\t\t\t\t\t"--tw-prose-bullets": theme("colors.textColor / 1"),\n\t\t\t\t\t\t"--tw-prose-code": theme("colors.textColor / 1"),\n\t\t\t\t\t\t"--tw-prose-headings": theme("colors.accent-2 / 1"),\n\t\t\t\t\t\t"--tw-prose-hr": "0.5px dashed #666",\n\t\t\t\t\t\t"--tw-prose-links": theme("colors.textColor / 1"),\n\t\t\t\t\t\t"--tw-prose-quotes": theme("colors.quote / 1"),\n\t\t\t\t\t\t"--tw-prose-th-borders": "#666",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tsm: {\n\t\t\t\t\tcss: {\n\t\t\t\t\t\tcode: {\n\t\t\t\t\t\t\tfontSize: theme("fontSize.sm")[0],\n\t\t\t\t\t\t\tfontWeight: "400",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t})',\n\t\tborderRadius: {\n\t\t\tlg: 'var(--radius)',\n\t\t\tmd: 'calc(var(--radius) - 2px)',\n\t\t\tsm: 'calc(var(--radius) - 4px)'\n\t\t}\n\t}\n},\n};\n\nexport default config;\n"
Stack: Error: Error replacing tree: The children of the old and new trees were expected to have the same count (6:53).
at ParentFinderReplacementNodeHandler.handleChildren (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:1436:19)
at ParentFinderReplacementNodeHandler.handleNode (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:1430:18)
at ParentFinderReplacementNodeHandler.handleNode (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:1570:19)
at doManipulation (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:2282:21)
at insertIntoParentTextRange (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:2317:5)
at ObjectLiteralExpression.replaceWithText (/Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/ts-morph/dist/ts-morph.js:3644:9)
at pr (file:///Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/shadcn/dist/index.js:5:4960)
at async cr (file:///Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/shadcn/dist/index.js:5:3929)
at async He (file:///Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/shadcn/dist/index.js:5:3524)
at async ae (file:///Users/wucanhao/.npm/_npx/d66c5096c7023bfb/node_modules/shadcn/dist/index.js:21:9744)

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

4 participants