ui icon indicating copy to clipboard operation
ui copied to clipboard

[bug]: Canary monorepo CLI ENOENT error

Open innovations-dev opened this issue 1 year ago • 12 comments

Describe the bug

The followin error occurs after running the cli install command: 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 /home/gsdev/dev/w82
spawn cd ENOENT

NOTE: The monorepo seems to install but only apps/web gets installed. I also tested this on an M1 mac and that worked fine.

Affected component/components

n/a

How to reproduce

  1. Install using the command provided in the monorepo docs: pnpm dlx shadcn@canary init
  2. Complete install wizard
  3. Error is thrown shortly after

Codesandbox/StackBlitz link

n/a

Logs

No response

System Info

Windows 11, WSL, Ubuntu 24.04

Before submitting

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

innovations-dev avatar Dec 27 '24 05:12 innovations-dev

Hello, I got the same error

AnasSahel avatar Jan 03 '25 11:01 AnasSahel

Same with bun got an error I am using WSL and I think it's most likely a problem with WSL

✖ 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: bun install
Resolving dependencies
Resolved, downloaded and extracted [24]
error: Workspace dependency "@workspace/eslint-config" not found

Searched in "./*"

Workspace documentation: https://bun.sh/docs/install/workspaces


error: Workspace dependency "@workspace/typescript-config" not found

Searched in "./*"

Workspace documentation: https://bun.sh/docs/install/workspaces

error: @workspace/eslint-config@* failed to resolve
error: @workspace/typescript-config@* failed to resolve
bun install v1.1.42 (50eec002)

apophis30 avatar Jan 10 '25 17:01 apophis30

used pnpm dlx shadcn@canary init and hit the same error

Qodestackr avatar Jan 20 '25 05:01 Qodestackr

Same with bun got an error I am using WSL and I think it's most likely a problem with WSL

✖ 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: bun install
Resolving dependencies
Resolved, downloaded and extracted [24]
error: Workspace dependency "@workspace/eslint-config" not found

Searched in "./*"

Workspace documentation: https://bun.sh/docs/install/workspaces


error: Workspace dependency "@workspace/typescript-config" not found

Searched in "./*"

Workspace documentation: https://bun.sh/docs/install/workspaces

error: @workspace/eslint-config@* failed to resolve
error: @workspace/typescript-config@* failed to resolve
bun install v1.1.42 (50eec002)

Am on Ubuntu though lol

Qodestackr avatar Jan 20 '25 05:01 Qodestackr

+1

ericmesmo avatar Jan 29 '25 11:01 ericmesmo

+1

ohexa avatar Feb 03 '25 22:02 ohexa

+1

ox1212 avatar Feb 23 '25 21:02 ox1212

ubuntu@ip-172-31-9-98:~$ pnpm dlx shadcn@canary init ✔ The path /home/ubuntu does not contain a package.json file. Would you like to start a new project? › Next.js (Monorepo) ✔ What is your project named? … en ✖ 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/ubuntu spawn cd ENOENT

ubuntu@ip-172-31-9-98:~$ npx shadcn@canary init Need to install the following packages: [email protected] Ok to proceed? (y) y

✔ The path /home/ubuntu does not contain a package.json file. Would you like to start a new project? › Next.js (Monorepo) ✔ What is your project named? … en

A project with the name en already exists. Please choose a different name and try again. same error please fix it @shadcn

santosh-marar avatar Feb 27 '25 13:02 santosh-marar

Should be fixed now. can you try again?

shadcn avatar Mar 05 '25 13:03 shadcn

Should be fixed now. can you try again?

Result:

➜  ~ pnpm dlx shadcn@canary init

✔ The path /home/noname does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)

✔ What is your project named? … test

✖ 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/noname
spawn cd ENOENT

➜  ~ cd test

➜  test git:(master) ls 
apps  node_modules  package.json  packages  pnpm-lock.yaml  pnpm-workspace.yaml  README.md  tsconfig.json  turbo.json

ohexa avatar Mar 08 '25 01:03 ohexa

pnpm dlx shadcn@canary init ✔ The path /home/ubuntu 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 ENOENT: cd /home/ubuntu spawn cd ENOENT

and while using npm npx shadcn@canary init ✔ The path /home/ubuntu 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: /home/ubuntu/.npm/_logs/2025-03-12T03_03_34_944Z-debug-0.log hey, @shadcn this problem is still not solve please fix it

santosh-marar avatar Mar 12 '25 03:03 santosh-marar

Taking a look. Will see if I can reproduce.

shadcn avatar Mar 12 '25 05:03 shadcn

Same here, WSL on WIndows 11

adriano-tirloni avatar Mar 25 '25 18:03 adriano-tirloni

Same on Linux Debian 12, but not on Mac OsX. ZSH, NVM with Node 12 for both.

guix77 avatar Mar 25 '25 20:03 guix77

im having same issue but a with a slight variation

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

dest already exists.```

Avinash-Tallapaneni avatar Apr 05 '25 15:04 Avinash-Tallapaneni

@shadcn Any updates?

eestpavel avatar May 15 '25 06:05 eestpavel

im having same issue but a with a slight variation

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

dest already exists.```

I still have this same issue too. Running Manjaro Linux and tried with almost every package manager (npm, pnpm, bun). I also notice that the "dest already exists." error shows up when I specified the project name as "." to initiate the project in the current directory. when i tried the default option "my-app" I got the original error

➜ 12:55 jakka example-mono pnpm dlx shadcn@canary init

✔ The path /home/jakka/Code/example-mono 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 ENOENT: cd /home/jakka/Code/example-mono
spawn cd ENOENT

gxjakkap avatar May 26 '25 05:05 gxjakkap

getting this on macos with @latest and @canary if I set the app name to '.' I get this, if I input a name when prompted I get EUNSUPPORTEDPROTOCOL npm error Unsupported URL Type "workspace:": workspace:*

Whats-A-MattR avatar Jul 04 '25 07:07 Whats-A-MattR

I use Ubuntu. I am also having this issue.

iltan@iltan:~/projects$ pnpm dlx shadcn@canary init
 WARN  1 deprecated subdependencies found: [email protected]
Packages: +293
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 293, reused 292, downloaded 1, added 293, done
✔ The path /home/iltan/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 ENOENT: cd /home/iltan/projects
spawn cd ENOENT

Also:

iltan@iltan:~/projects$ node -v
v22.17.1
iltan@iltan:~/projects$ npm -v
10.9.2
iltan@iltan:~/projects$ pnpm -v
10.13.1

iltan987 avatar Jul 24 '25 21:07 iltan987

Yeah I'm getting the same error on Linux. Tried npm, pnpm, bun.

bunx --bun shadcn@canary init
✔ The path /workspaces/echo-tutorial does not contain a package.json file.
  Would you like to start a new project? › Next.js (Monorepo)
✔ What is your project named? … echo-tutorial
✖ 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: bun install
Resolving dependencies
Resolved, downloaded and extracted [26]
error: Workspace dependency "@workspace/eslint-config" not found

Searched in "./*"

Workspace documentation: https://bun.com/docs/install/workspaces


error: Workspace dependency "@workspace/typescript-config" not found

Searched in "./*"

Workspace documentation: https://bun.com/docs/install/workspaces

error: @workspace/eslint-config@workspace:* failed to resolve
error: @workspace/typescript-config@workspace:* failed to resolve
bun install v1.2.19 (aad3abea)

acho1833 avatar Aug 05 '25 01:08 acho1833

same error still

the-name-romel avatar Aug 05 '25 05:08 the-name-romel

Fixed in #7962

shadcn avatar Aug 07 '25 10:08 shadcn

Morning, guys. @shadcn I'm facing the same issue when running the pnpm dlx shadcn@canary init commadn on ubuntu 24.04.3 LtS

Node.js version: v22.21.0 pnpm version: 10.15.0

pnpm dlx shadcn@canary init
✔ The path /home/jesus-medina/Documents/GitHub/finstate-fe 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 ENOENT: cd /home/jesus-medina/Documents/GitHub/finstate-fe
spawn cd ENOENT

Jesusm1229 avatar Oct 21 '25 13:10 Jesusm1229