nx-extend icon indicating copy to clipboard operation
nx-extend copied to clipboard

Error when running `nx run ui-lib:add-component ....` due to 'shadcn-ui' not being recognized

Open thealirexa opened this issue 1 year ago • 5 comments

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

  1. Run nx run ui-lib:add-component card.
  2. 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.

thealirexa avatar Sep 01 '24 10:09 thealirexa

I can confirm the same error happening with a fresh installation of today

SinPP avatar Sep 17 '24 05:09 SinPP

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.

TriPSs avatar Sep 17 '24 05:09 TriPSs

image

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

SinPP avatar Sep 17 '24 06:09 SinPP

Are there any solutions yet?

dongjin2008 avatar Sep 21 '24 10:09 dongjin2008

Aperently they changed the CLI https://ui.shadcn.com/docs/changelog.

TriPSs avatar Sep 23 '24 09:09 TriPSs

@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 :(

murbanowicz avatar Sep 27 '24 20:09 murbanowicz

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.

TriPSs avatar Sep 27 '24 20:09 TriPSs