pnpm:  ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  not found: xxx

ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  not found: vite

pnpm version:

pnpm -v
6.24.1

Code to reproduce the issue:

mkdir test
cd test
pnpm init -y
pnpm install vite
pnpm vite

Expected behavior:

vite  dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

Actual behavior:

 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  not found: vite

Additional information:

node -v
v16.13.1
  • macOS

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 18
  • Comments: 33 (3 by maintainers)

Most upvoted comments

Same problem over here

Hello. I am having the same issue on the latest pnpm version 7.19.0 ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL

You should update your “pnpm” version. it will work well

Hey is there any solution for this to run? I’m facing the same issue.

pnpm -v   8.15.5
node -v    v20.5.1
Windows 11

pnpm build ‘build’ is not recognized as an internal or external command, operable program or batch file.  ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Command “build” not found

because of pnpm version is lower than 7

just updated from 8.6.4 to 8.6.11 and this error is back. It runs the command but then says it’s not found and exists with exit code 1.

Same problem over here

I was my bad, I used pnpm ci, assuming that the syntax is compatible. Using pnpm install works.

I faced same issue This is my project structure:

MAIN_PROJECT
      |
      |____FE_FOLDER
               |
               |____package.json
               |
               |____....

Initially, I ran the pnpm dev command from ~MAIN_PROJECT/ and encountered the error ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "dev" not found. After that, I changed to ~MAIN_PROJECT/FE_FOLDER and ran pnpm dev again, and it succeeded.

I’m not sure if others have faced the same idiot error as I did, but please double-check the folder you’re in when running the command.

For me, I was running the pnpm command from another directory and passing the -c flag: pnpm -C PATH_TO_PROJECT prisma generate

I used exec instead and it worked

pnpm -C PATH_TO_PROJECT exec prisma generate

If you are running bash scripts locally or in CI / CD processes, you may encounter this error. If that is the case, consider the following.

  1. If you are using composer to register your scripts, this error occurs because composer generates a proxy script in vendor/bin directory that points to your original script. This proxy script may not capture errors correctly when calling your original script resulting this error.
  2. If you are using NODE JS, a proxy script is also generated in node_modules. PNPM uses symbolic links to point to the original script in .pnpm directory.

In both cases, make sure your scripts have:

  • EXECUTABLE PERMISSION
  • Debug your scripts locally and catch errors according before deploying with composer or NPM.