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);
^
/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/plugin-transform-typescript/lib/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at Object. (/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/helper-member-expression-to-functions/lib/index.js:5:10)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/helper-member-expression-to-functions/lib/index.js',
'/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/helper-replace-supers/lib/index.js',
'/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js',
'/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/helper-create-class-features-plugin/lib/index.js',
'/Users/chetanbhoasle/.npm/_npx/d66c5096c7023bfb/node_modules/@babel/plugin-transform-typescript/lib/index.js'
]
}
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
[X] I've made research efforts and searched the documentation
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
Before submitting