Skip to content

[bug]: CLI errors out when attempting to generate the Next.js monorepo example #8325

@johncmunson

Description

@johncmunson

Describe the bug

Problem

When using the shadcn CLI to generate a new Next.js monorepo project, the CLI successfully gets started on scaffolding a repo, but the CLI errors out before it can finish. It's not clear to me whether or not there was more scaffolding work to be done. I've tested this with both npm and pnpm.

Is This Only a Problem With the Monorepo Example?

Yes. I verified that the CLI completes successfully when trying to scaffold a regular Next.js repo.

Screenshots

Error - Try to generate a Next.js monorepo using npm

Image

Error - Try to generate a Next.js monorepo using pnpm

Image

Success! - Try to generate a regular Next.js repo using npm

Image

Affected component/components

CLI, specifically the monorepo example

How to reproduce

How to reproduce the bug

  1. Create an empty folder and cd into it: mkdir shadcn-monorepo-example && cd shadcn-monorepo-example
  2. Execute the shadcn CLI: npx shadcn@canary init or pnpm dlx shadcn@canary init
  3. When asked project type, select `Next.js (monorepo)

How to reproduce my environment

  1. Ideally, use a Windows 11 machine with WSL 2. However, you could also probably use macOS and be fine.
  2. Open VSCode and create a dev container
// .devcontainer/devcontainer.json
{
  "name": "Node.js & TypeScript",
  "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
}
  1. From the command pallette, run Dev Containers: Reopen in Container

Codesandbox/StackBlitz link

Not applicable

Logs

**npm** - `npx shadcn@canary init`

✖ 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: /home/node/.npm/_logs/2025-10-01T20_37_54_748Z-debug-0.log


**pnpm** - `pnpm dlx shadcn@canary init`

✖ 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 ENOENT: cd /workspaces/shadcn-monorepo-example
spawn cd ENOENT

System Info

OS: Windows 11 with WSL 2
Dev Environment: VSCode dev container - `mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm`

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions