supabase-cli installation via pnpm is broken
Describe the bug
supabase-cli installation via pnpm is broken
To Reproduce Follow the quick start docs using pnpm
- pnpm add supabase --save-dev
WARN Failed to create bin at /node_modules/.bin/supabase. ENOENT: no such file or directory, open '/node_modules/.pnpm/[email protected]/node_modules/supabase/bin/supabase'
- pnpm supabase --version
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "supabase" not found
Expected behavior
``pnpm supabase` should work
Screenshots I
System information
Rerun the failing command with --create-ticket flag.
- Ticket ID:
- Version of OS: Fedora Linux 42
- Version of CLI: 2.22.6
- Version of Docker: Podman 5.4.2
- Versions of services:
Additional context If applicable, add any other context about the problem here.
- Browser Chrom
- Version of supabase-js v2.22.6
- Version of Node.js 23.11.0
It's likely your pnpm doesn't have permission to create directories in the directory it mentioned. This isn't a CLI issue, it's more of a pnpm and your operating system issue. I use pnpm for most of my projects with the CLI and have never encountered this issue before. This is both on Windows and Ubuntu.
unlikely, the error seem to tell that pnpm was unable to create a link to the supabase executable to the bin folder because it couldn't find it in the original [email protected] folder.
In fact, I'm not the only one encounter the problem: https://github.com/supabase/cli/issues/3026#issuecomment-2819590490
I also see have the same issue as of today. pnpm install was previous fine. I now get similar:
WARN Failed to create bin at [project_dir]\node_modules\.pnpm\node_modules\.bin\supabase. ENOENT: no such file or directory, stat '[project_dir]\node_modules\.pnpm\node_modules\supabase\bin\supabase.EXE' WARN Failed to create bin at [project_dir]\services\database\node_modules\.bin\supabase. ENOENT: no such file or directory, stat '[project_dir]\node_modules\.pnpm\[email protected]\node_modules\supabase\bin\supabase.EXE'
I just ran the command provided in the OP and I got the warning message but when I ran pnpm supabase it all worked as expected. I'm using WSL2 Ubuntu. The warning has always been there from what I can remember but it installs the package after that with the postinstall script.
Confirming, this seems to be broken since v2.22.6
pnpm dlx [email protected] works as expected, pnpm dlx [email protected] fails with ENOENT Command failed with ENOENT: supabase
Same issue using pnpm On my machine and vercel
@silentworks
It's likely your pnpm doesn't have permission to create directories in the directory it mentioned. This isn't a CLI issue, it's more of a
pnpmand your operating system issue. I usepnpmfor most of my projects with the CLI and have never encountered this issue before. This is both on Windows and Ubuntu.
This issue happen when deploy to vercel too
pnpm added a new security measure which you have to manually approve of executable when calling them from the terminal. I believe this is what is causing this issue.
@silentworks
pnpmadded a new security measure which you have to manually approve of executable when calling them from the terminal. I believe this is what is causing this issue.
How ?
@bennajah you now have to approve builds with pnpm. You can see the warning here in my project and it says I should run pnpm approve-builds manually before the CLI will be functional. This change was made somewhere in v10 of pnpm.
pnpm approve-builds , then approve supabase worked for me
pnpm approve-builds, then approve supabase worked for me
Same here. In my case, I had to pnpm install --force the existing project to properly reinstall everything and then be prompted with the "approve-builds" warning.
This is an upstream issue with pnpm with a known workaround
pnpm add supabase --save-dev --allow-build=supabase
https://github.com/pnpm/pnpm/issues/9124#issuecomment-2663021284
this worked for me . pnpm 10+
rm -rf node_modules/.pnpm/supabase* && pnpm remove supabase && pnpm add -D supabase