Skip to content

[bug]: NextJS Monorepo install failing #7160

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

Open
2 tasks done
lelandcope opened this issue Apr 8, 2025 · 2 comments
Open
2 tasks done

[bug]: NextJS Monorepo install failing #7160

lelandcope opened this issue Apr 8, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@lelandcope
Copy link

lelandcope commented Apr 8, 2025

Describe the bug

When running npx shadcn@canary init and selecting Next.js (Monorepo) I get the following error

Image

Affected component/components

The initial installation

How to reproduce

  1. Run npx shadcn@latest init
  2. Select Next.js (Monorepo)

Codesandbox/StackBlitz link

No response

Logs

0 verbose cli /Users/lelandcope/.nvm/versions/node/v20.10.0/bin/node /Users/lelandcope/.nvm/versions/node/v20.10.0/bin/npm
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/Users/lelandcope/projects/my-app/.npmrc Completed in 1ms
10 timing config:load:project Completed in 2ms
11 timing config:load:file:/Users/lelandcope/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/Users/lelandcope/.nvm/versions/node/v20.10.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 0ms
16 timing config:load Completed in 5ms
17 timing npm:load:configload Completed in 5ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 0ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm install
22 verbose argv "install"
23 timing npm:load:setTitle Completed in 5ms
24 timing npm:load:display Completed in 1ms
25 verbose logfile logs-max:10 dir:/Users/lelandcope/.npm/_logs/2025-04-08T23_29_04_737Z-
26 verbose logfile /Users/lelandcope/.npm/_logs/2025-04-08T23_29_04_737Z-debug-0.log
27 timing npm:load:logFile Completed in 3ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 19ms
31 timing arborist:ctor Completed in 0ms
32 silly logfile start cleaning logs, removing 1 files
33 silly logfile done cleaning log files
34 timing arborist:ctor Completed in 0ms
35 timing idealTree:init Completed in 4ms
36 timing idealTree:userRequests Completed in 0ms
37 silly idealTree buildDeps
38 timing idealTree Completed in 5ms
39 timing command:install Completed in 9ms
40 verbose stack Error: Unsupported URL Type "workspace:": workspace:*
40 verbose stack     at unsupportedURLType (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:310:15)
40 verbose stack     at fromURL (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:367:13)
40 verbose stack     at Function.resolve (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/npm-package-arg/lib/npa.js:83:12)
40 verbose stack     at #nodeFromEdge (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1048:22)
40 verbose stack     at #buildDepStep (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:917:35)
40 verbose stack     at #buildDeps (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:769:30)
40 verbose stack     at Arborist.buildIdealTree (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:196:28)
40 verbose stack     at async Promise.all (index 1)
40 verbose stack     at async Arborist.reify (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:159:5)
40 verbose stack     at async Install.exec (/Users/lelandcope/.nvm/versions/node/v20.10.0/lib/node_modules/npm/lib/commands/install.js:152:5)
41 verbose cwd /Users/lelandcope/projects/my-app
42 verbose Darwin 24.3.0
43 verbose node v20.10.0
44 verbose npm  v10.2.3
45 error code EUNSUPPORTEDPROTOCOL
46 error Unsupported URL Type "workspace:": workspace:*
47 verbose exit 1
48 timing npm Completed in 107ms
49 verbose unfinished npm timer reify 1744154944835
50 verbose unfinished npm timer reify:loadTrees 1744154944837
51 verbose unfinished npm timer idealTree:buildDeps 1744154944842
52 verbose unfinished npm timer idealTree:#root 1744154944842
53 verbose code 1
54 error A complete log of this run can be found in: /Users/lelandcope/.npm/_logs/2025-04-08T23_29_04_737Z-debug-0.log

System Info

Node v20
Mac OS 15.3.2

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@lelandcope lelandcope added the bug Something isn't working label Apr 8, 2025
@vsDizzy
Copy link

vsDizzy commented Apr 9, 2025

Have you tried to run canary instead?

npx shadcn@canary init

For me it worked with pnpm

pnpm dlx shadcn@canary init
Packages: +220
++++++++++++++++++++++++++++++++++++
Progress: resolved 220, reused 131, downloaded 89, added 220, done
√ The path D:\dev\next-app 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
√ Creating a new Next.js monorepo.
Success! Project initialization completed.
You may now add components.

@lelandcope
Copy link
Author

@vsDizzy Whoops that was a typo in the above. I was using npx shadcn@canary init.

To me what it looks like is happening is it setting pnpn workspaces for npm workspaces.

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

2 participants