zoom-clone icon indicating copy to clipboard operation
zoom-clone copied to clipboard

issue with Run the CLI command "npx shadcn-ui@latest init"

Open jaafar2000 opened this issue 10 months ago • 2 comments

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\jaafa\AppData\Local\npm-cache_npx\125ee17d583c4e03\node_modules\diff\lib\index.mjs' imported from C:\Users\jaafa\AppData\Local\npm-cache_npx\125ee17d583c4e03\node_modules\shadcn-ui\dist\index.js Did you mean to import "diff/lib/index.js"? at finalizeResolution (node:internal/modules/esm/resolve:265:11) at moduleResolve (node:internal/modules/esm/resolve:933:10) at defaultResolve (node:internal/modules/esm/resolve:1157:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:390:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:359:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:234:38) at ModuleWrap. (node:internal/modules/esm/module_job:87:39) at link (node:internal/modules/esm/module_job:86:36) { code: 'ERR_MODULE_NOT_FOUND', url: 'file:///C:/Users/jaafa/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/diff/lib/index.mjs' }

jaafar2000 avatar Apr 09 '24 04:04 jaafar2000

try deleting node_modules and then run npm i command. Then run the shadcn command. Should fix it.

anisharya16 avatar Apr 27 '24 06:04 anisharya16

Even better approach is to delete the entire project folder and start from scratch, make sure you update your npm, node versions and you are using latest versions of all the necessary tools. The other better way to work is to take the checkout of main branch and delete the code part and keep the config part. That would be a better starter boilerplate for you.

bharatpaliwal-169 avatar Apr 28 '24 06:04 bharatpaliwal-169