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

[bug]: npm error Unsupported URL Type "workspace:": workspace:* using npx shadcn@canary init #6421

Open
2 tasks done
whdgur5717 opened this issue Jan 22, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@whdgur5717
Copy link

whdgur5717 commented Jan 22, 2025

Describe the bug

When creating a new project and running npx shadcn@canary init, selecting the next.js(monorepo) version results in an EUNSUPPORTEDPROTOCOL error.

In my opinion, The reason for this is likely that Shadcn defaults to npm when it cannot detect a package manager, then attempts to run the npm install command. However, the monorepo template files are based on pnpm, which causes compatibility issues and results in the error

Affected component/components

CLI init(monorepo)

How to reproduce

  1. make empty project
  2. execute npx shadcn@canary init
  3. Would you like to start a new project? › Next.js (Monorepo)

Codesandbox/StackBlitz link

No response

Logs

shadcn-mono-test git:(main) npx shadcn@canary init                            

✔ The path /Users/jh/shadcn-mono-test does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … my-app
✖ Something went wrong creating a new Next.js monorepo.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

Command failed with exit code 1: npm install
npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*
npm error A complete log of this run can be found in: /Users/jh/.npm/_logs/2025-01-22T06_59_21_296Z-debug-0.log

System Info

mac

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@whdgur5717 whdgur5717 added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant