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

Volta error: Could not locate executable pnpm in your project #1293

Closed
Mr-xzq opened this issue Aug 17, 2022 · 4 comments
Closed

Volta error: Could not locate executable pnpm in your project #1293

Mr-xzq opened this issue Aug 17, 2022 · 4 comments

Comments

@Mr-xzq
Copy link

Mr-xzq commented Aug 17, 2022

Even if you have pnpm installed globally.

When you set packageManager and pnpm as devDependencies in package.json:

{
  "packageManager": "[email protected]",
  "devDependencies": {
    "pnpm": "7.9.0",
   }
}

Then you run command in project:

pnpm install

Error Info:

Volta error: Could not locate executable `pnpm` in your project.

Please ensure that all project dependencies are installed with `npm install` or `yarn install`

Is it related to this?
https://docs.volta.sh/guide/understanding#managing-your-project

@charlespierce
Copy link
Contributor

Hi @Mr-xzq, thanks for the question! There are a couple of connected issues here:

  1. Volta doesn't currently support pnpm special-cased as a package manager like yarn and npm. There's a PR open to add that, however even when it does, Volta also doesn't use the packageManager key, rather it uses the volta key as described in the "Managing Your Project" section you linked.
  2. For global packages (which is how Volta currently treats pnpm, given the first issue), if a project has a dependency on a binary (like you have with pnpm in devDependencies, then Volta will attempt to delegate to the local version. However, in this case, the package manager itself is what is listed as a dependency, so it's a bit of a dependency loop.

For the time being, I believe it should work to use the global default version of pnpm if you remove the devDependencies entry for pnpm. Longer-term, once #1273 lands then we'll directly support pinning pnpm via volta pin pnpm. We also can separately investigate using packageManager as a source of truth, but there's still some outstanding design that needs to be done on using separate sources of truth (see #282 for that tracking issue).

@Mr-xzq
Copy link
Author

Mr-xzq commented Aug 17, 2022

Hi @charlespierce, thank you very much for your answer!

Your answer solved my question very well!

I just need to remove pnpm in devDependencies:

{
  "devDependencies": {
--    "pnpm": "7.9.0",
   }
}

Looking forward to the follow-up progress of Volta's support for pnpm. #1273

@Mr-xzq Mr-xzq closed this as completed Aug 17, 2022
@FiringJ
Copy link

FiringJ commented Mar 1, 2024

tks. after i delete 'pnpm' in devDependencies, pnpm install works.

@jxxl998
Copy link

jxxl998 commented Oct 30, 2024

thx, same problem here but works fine after deleting devDependencies, still, i don't fully understand why it will result in dependency loop 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants