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]: EUNSUPPORTEDPROTOCOL while trying to create monorepo #6193

Open
2 tasks done
iChintanSoni opened this issue Dec 28, 2024 · 6 comments
Open
2 tasks done

[bug]: EUNSUPPORTEDPROTOCOL while trying to create monorepo #6193

iChintanSoni opened this issue Dec 28, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@iChintanSoni
Copy link

iChintanSoni commented Dec 28, 2024

Describe the bug

While creating a new monorepo project, it throws below error:

chintansoni@192 projects % npx shadcn@canary init
✔ The path /Users/chintansoni/projects does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … shadcn-monorepo
✖ 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/chintansoni/.npm/_logs/2024-12-28T06_33_50_510Z-debug-0.log

Affected component/components

Project creation

How to reproduce

  1. Go to the terminal
  2. Execute: npx shadcn@canary init
  3. In the first prompt Would you like to start a new project?, select Next.js (Monorepo)
  4. In the next prompt What is your project named?, enter the project name shadcn-monorepo

Codesandbox/StackBlitz link

No response

Logs

0 verbose cli /Users/chintansoni/.nvm/versions/node/v22.8.0/bin/node /Users/chintansoni/.nvm/versions/node/v22.8.0/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/chintansoni/projects/shadcn-monorepo/.npmrc
5 silly config load:file:/Users/chintansoni/.npmrc
6 silly config load:file:/Users/chintansoni/.nvm/versions/node/v22.8.0/etc/npmrc
7 verbose title npm install
8 verbose argv "install"
9 verbose logfile logs-max:10 dir:/Users/chintansoni/.npm/_logs/2024-12-28T06_33_50_510Z-
10 verbose logfile /Users/chintansoni/.npm/_logs/2024-12-28T06_33_50_510Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly packumentCache heap:2197815296 maxSize:549453824 maxEntrySize:274726912
13 silly logfile done cleaning log files
14 silly idealTree buildDeps
15 verbose stack Error: Unsupported URL Type "workspace:": workspace:*
15 verbose stack     at unsupportedURLType (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:310:15)
15 verbose stack     at fromURL (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:367:13)
15 verbose stack     at Function.resolve (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:83:12)
15 verbose stack     at #nodeFromEdge (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1039:22)
15 verbose stack     at #buildDepStep (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:904:35)
15 verbose stack     at #buildDeps (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:757:30)
15 verbose stack     at Arborist.buildIdealTree (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:181:28)
15 verbose stack     at async Promise.all (index 1)
15 verbose stack     at async Arborist.reify (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
15 verbose stack     at async Install.exec (/Users/chintansoni/.nvm/versions/node/v22.8.0/lib/node_modules/npm/lib/commands/install.js:150:5)
16 error code EUNSUPPORTEDPROTOCOL
17 error Unsupported URL Type "workspace:": workspace:*
18 silly unfinished npm timer reify 1735367630748
19 silly unfinished npm timer reify:loadTrees 1735367630748
20 silly unfinished npm timer idealTree:buildDeps 1735367630753
21 silly unfinished npm timer idealTree:#root 1735367630753
22 verbose cwd /Users/chintansoni/projects/shadcn-monorepo
23 verbose os Darwin 24.2.0
24 verbose node v22.8.0
25 verbose npm  v10.9.0
26 verbose exit 1
27 verbose code 1
28 error A complete log of this run can be found in: /Users/chintansoni/.npm/_logs/2024-12-28T06_33_50_510Z-debug-0.log

System Info

Macbook Air
Chip: Apple M2
Memory: 8 GB
OS: Sequoia

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@iChintanSoni iChintanSoni added the bug Something isn't working label Dec 28, 2024
@pirmax
Copy link

pirmax commented Dec 28, 2024

Same problem here on WSL on Windows 11 and MacOS too.

@PedroMarianoAlmeida
Copy link

As a workaround, you can check my own Turborepo with shadcn as a package

https://github.com/PedroMarianoAlmeida/offical-turbo-v1/tree/main/packages/react/shadcn

I start with this example (https://github.com/vercel/turborepo/tree/main/examples/with-tailwind) and then start working on that

@morganbarber
Copy link

Using pnpm solved this issue for me.

@z1haze
Copy link

z1haze commented Jan 9, 2025

despite the documentation showing the scripts for init for npm, pnpm, bun, etc... clearly the only one they tested was pnpm. I think we have to just dump contents of the example folder into your new project, delete the pnpm stuff, add the workspaces to the package.json, etc.

@evokerking2
Copy link

Same

@qwerqy
Copy link

qwerqy commented Jan 16, 2025

I faced this issue while i was on [email protected] (if I'm not mistaken, does not support workspace). Using [email protected] solves the issue

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

7 participants