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
75.14k stars 4.69k forks source link

[bug]: Facing installation issue while installing shadcn in nextjs project in MacOs #5424

Open ChetanBhosale opened 1 month ago

ChetanBhosale commented 1 month ago

Describe the bug

I am trying to install shadcn in nextjs project but it is giving an error

npm error A complete log of this run can be found in: /Users/chetanbhoasle/.npm/_logs/2024-10-18T11_24_44_051Z-debug-0.log chetanbhoasle@chetans-MacBook-Air manager-lead % sudo npx shadcn@latest init

node:internal/modules/cjs/loader:1140 const err = new Error(message); ^

Error: Cannot find module '@babel/types' Require stack:

Node.js v18.20.4

Affected component/components

application

How to reproduce

create a new next js project install shadcn

Codesandbox/StackBlitz link

bug

Logs

No response

System Info

Mac Os M1 8GB 256SSD

Before submitting

Mikyas1 commented 1 month ago

I am facing the same issues @ChetanBhosale, were you able to fix it?

ChetanBhosale commented 1 month ago

yes, remove nodejs from your mac and install it again using nvm, but you need to remove nodejs from core so for that follow this tutorial

https://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x