nx-extend
nx-extend copied to clipboard
Error when running `nx run ui-lib:add-component ....` due to 'shadcn-ui' not being recognized
Description
When trying to add a component using the command nx run ui-lib:add-component card, I encountered an error indicating that shadcn-ui is not recognized as a command.
It worked yesterday, but today it doesn't! I think it's due to the shadcn/cli upgrade!
Command Run
nx run ui-lib:add-component card
Output/Error Message
Running:
npx shadcn-ui@latest add card --path=src --cwd=ui-lib
'shadcn-ui' is not recognized as an internal or external command,
operable program or batch file.
——————————————————————————————————————————————————————————————————————————————————————————————————————————————
NX Ran target add-component for project ui-lib (3s)
With additional flags:
card
× 1/1 failed
√ 0/1 succeeded [0 read from cache]
Expected Behavior
The command should successfully add the card component to the project without any errors.
Steps to Reproduce
- Run
nx run ui-lib:add-component card. - Observe the error related to
shadcn-ui.
Additional Context
If this issue is specific to my environment or setup, please let me know if there are any dependencies or steps I might be missing.
I can confirm the same error happening with a fresh installation of today
Hmm, you can run like this NX_EXTEND_COMMAND_USE_NPX=true nx run ui-lib:add-component card and in the meantime I will check it out.
For whatever reason it complains that sahadcn-ui is not found, even though it is installed locally, globally and through npx should be no problem whatsoever.
Edit: Command: NX_EXTEND_COMMAND_USE_NPX=true nx run ui-admin:add-component card
Are there any solutions yet?
Aperently they changed the CLI https://ui.shadcn.com/docs/changelog.
@TriPSs any chance to get it fixed soon? Don't want to be nasty or so, so don't take me like that. Just asking because your plugin came as life-saver for me, but I hit this wall unfortunately :(
To be honest here: I did a quick look and did not get anything working yet, I am still using the plugin but not very actively so think I will fix this once I need it again.
I can still try to fix the version that is being used, maybe that helps.
And of course: any PR fixing this is also appreciated.