ui
ui copied to clipboard
Cannot find module '@ts-morph/common'
Got an error while init shadcn/ui, this happen when I create new next js app and want installing shadcn/ui. Please help me to fix this
Here's the error that i got
node:internal/modules/cjs/loader:1144
const err = new Error(message);
^
Error: Cannot find module '@ts-morph/common'
Require stack:
- C:\Users\user123\AppData\Local\npm-cache\_npx\125ee17d583c4e03\node_modules\ts-morph\dist\ts-morph.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (C:\Users\user123\AppData\Local\npm-cache\_npx\125ee17d583c4e03\node_modules\ts-morph\dist\ts-morph.js:3:14)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:356:17) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\user123\\AppData\\Local\\npm-cache\\_npx\\125ee17d583c4e03\\node_modules\\ts-morph\\dist\\ts-morph.js'
]
}
Node.js v20.11.0
Regards, Zidd
Would you share your steps of the installation with the screenshots of the terminal?
Did you try install this module?
I had the same error. Using the latest version npx [email protected] init
works fine for me
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.
At C:\Users\user123\AppData\Local\npm-cache
the dependency's resolved as not found.
Remove the npm-cache at that location and do npm install
at project root, it will work.
At
C:\Users\user123\AppData\Local\npm-cache
the dependency's resolved as not found. Remove the npm-cache at that location and donpm install
at project root, it will work.
Have tried this solution on Ubuntu but doesn't work.
did you find any solution for this??
did you find any solution for this??
Yeah I did. Just tried the solution suggested by @mauriciomutte. When using npx shadcn-ui@latest ....
it was using version 0.2.x
of shadcn-ui. So what I did was uninstalling the package and explicitly use npx [email protected] add ...
. And it worked.