Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line is broken due to new ShadCN command line tool #95

Open
fer2d2 opened this issue Sep 4, 2024 · 2 comments
Open

Command line is broken due to new ShadCN command line tool #95

fer2d2 opened this issue Sep 4, 2024 · 2 comments

Comments

@fer2d2
Copy link

fer2d2 commented Sep 4, 2024

Hello,

When I try to use the command line to install a component, it fails because npx shadcn-ui is now called npx shadcn.

Example

npx @shadx/cli add file-upload

✔ file-upload requires the following shadcn-ui components button, input Proceed? … yes
⠴ installing button, input for file-upload...file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/lib/error.js:60
                error = new Error(message);
                        ^

Error: Command failed with exit code 127: npx shadcn-ui@latest add button input --overwrite
sh: 1: shadcn-ui: not found
    at makeError (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.<anonymous> (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/@shadx/cli/dist/index.js:309:9) {
  shortMessage: 'Command failed with exit code 127: npx shadcn-ui@latest add button input --overwrite',
  command: 'npx shadcn-ui@latest add button input --overwrite',
  escapedCommand: 'npx "shadcn-ui@latest" add button input --overwrite',
  exitCode: 127,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'sh: 1: shadcn-ui: not found',
  cwd: '/home/fernando/lenscenes.com',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Node.js v18.18.2

You can find more information at this link: https://ui.shadcn.com/docs/changelog

To fix this issue, @shadx/cli should invoke npx shadcn@latest instead of npx shadcn-ui@latest.

I am not an advanced user of command lines written in Node, so I cannot make a pull request, but I would appreciate it if you could review it to keep your tool up to date.

Thank you very much!

@rsxdalv
Copy link

rsxdalv commented Sep 13, 2024

Should be fixed, but FYI the command still works if you use these versions:

{

  "dependencies": {
    "@emotion/css": "^11.10.8",
    "@emotion/react": "^11.10.8",
    "@emotion/styled": "^11.10.8",
    "@gradio/client": "^1.4.0",
    "@material-design-icons/svg": "^0.14.7",
    "@radix-ui/react-dialog": "^1.1.1",
    "@radix-ui/react-icons": "^1.3.0",
    "@radix-ui/react-label": "^2.1.0",
    "@radix-ui/react-popover": "^1.1.1",
    "@radix-ui/react-progress": "^1.1.0",
    "@radix-ui/react-radio-group": "^1.2.0",
    "@radix-ui/react-select": "^2.1.1",
    "@radix-ui/react-separator": "^1.1.0",
    "@radix-ui/react-slider": "^1.2.0",
    "@radix-ui/react-slot": "^1.1.0",
    "@radix-ui/react-switch": "^1.1.0",
    "@types/node": "20.0.0",
    "@types/react": "18.2.5",
    "@types/react-dom": "18.2.4",
    "adm-zip": "^0.5.10",
    "autoprefixer": "10.4.14",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "cmdk": "^1.0.0",
    "country-flag-icons": "^1.5.7",
    "eslint": "8.40.0",
    "eslint-config-next": "13.4.1",
    "express": "^4.18.2",
    "iconv": "^3.0.1",
    "lucide-react": "^0.438.0",
    "music-metadata": "^8.1.4",
    "next": "13.5",
    "postcss": "8.4.23",
    "react": "^18.2.0",
    "react-aria-components": "^1.3.3",
    "react-dom": "18.2.0",
    "react-dropzone": "^14.2.3",
    "sonner": "^1.5.0",
    "tailwind-merge": "^2.5.2",
    "tailwindcss": "3.3.2",
    "tailwindcss-animate": "^1.0.7",
    "wavesurfer.js": "^7.3.9"
  },
  "devDependencies": {
    "@chromatic-com/storybook": "^1.8.0",
    "@storybook/addon-essentials": "^8.2.9",
    "@storybook/addon-interactions": "^8.2.9",
    "@storybook/addon-links": "^8.2.9",
    "@storybook/addon-onboarding": "^8.2.9",
    "@storybook/blocks": "^8.2.9",
    "@storybook/nextjs": "^8.2.9",
    "@storybook/react": "^8.2.9",
    "@storybook/test": "^8.2.9",
    "@types/adm-zip": "^0.5.0",
    "@types/express": "^4.17.20",
    "eslint-plugin-storybook": "^0.8.0",
    "storybook": "^8.2.9",
    "typescript": "^5.4.5"
  }
}

@Raphael-08
Copy link
Collaborator

Hello,

When I try to use the command line to install a component, it fails because npx shadcn-ui is now called npx shadcn.

Example

npx @shadx/cli add file-upload

✔ file-upload requires the following shadcn-ui components button, input Proceed? … yes
⠴ installing button, input for file-upload...file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/lib/error.js:60
                error = new Error(message);
                        ^

Error: Command failed with exit code 127: npx shadcn-ui@latest add button input --overwrite
sh: 1: shadcn-ui: not found
    at makeError (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.<anonymous> (file:///home/fernando/.npm/_npx/eb88041bc59518b4/node_modules/@shadx/cli/dist/index.js:309:9) {
  shortMessage: 'Command failed with exit code 127: npx shadcn-ui@latest add button input --overwrite',
  command: 'npx shadcn-ui@latest add button input --overwrite',
  escapedCommand: 'npx "shadcn-ui@latest" add button input --overwrite',
  exitCode: 127,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'sh: 1: shadcn-ui: not found',
  cwd: '/home/fernando/lenscenes.com',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Node.js v18.18.2

You can find more information at this link: https://ui.shadcn.com/docs/changelog

To fix this issue, @shadx/cli should invoke npx shadcn@latest instead of npx shadcn-ui@latest.

I am not an advanced user of command lines written in Node, so I cannot make a pull request, but I would appreciate it if you could review it to keep your tool up to date.

Thank you very much!

Fixed ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants