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]: Error ENOENT: spawn cd ENOENT when initializing Next.js monorepo project #7086

Open
2 tasks done
chun37 opened this issue Mar 30, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@chun37
Copy link

chun37 commented Mar 30, 2025

Describe the bug

Bug Description

When trying to initialize a new Next.js monorepo project using shadcn CLI, the process fails with an ENOENT error related to the cd command.

Additional Context

The error suggests that the CLI is trying to use cd as an executable command rather than using Node.js's process.chdir() method or handling directory changes appropriately.

Affected component/components

none

How to reproduce

  1. Navigate to a directory in the terminal
  2. Run pnpm dlx shadcn@latest init
  3. Select "Next.js (Monorepo)" option when prompted
  4. Enter project name (I used "aaa")

Codesandbox/StackBlitz link

No response

Logs

❯ pnpm dlx shadcn@latest init
Packages: +220
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 220, reused 220, downloaded 0, added 220, done
✔ The path /home/chun/programs does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … aaa
✖ 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 /home/chun/programs
spawn cd ENOENT

System Info

os: ubuntu 24.10
node.js: 22.14.0
pnpm: 9.5.0

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@chun37 chun37 added the bug Something isn't working label Mar 30, 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