You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Corepack included in NodeJS versions 14.19+, 16.19+, and 17+, some of us may want to use Volta for NodeJS version management only and leave package manager binaries to Corepack.
However, that doesn't seem to be doable at the moment as Volta doesn't expose the corepack binary, nor those it manages.
See an example and a complete reproduction below.
Corepack binary is not exposed:
$ volta install node@latest
success: installed and set[email protected] as default
note: this version of Node includes [email protected], which is higher than your default version (8.1.4).
To use the version included with Node, run `volta install npm@bundled`
$ node -v
v17.9.0
$ which node
/Users/<username>/.volta/bin/node
$ corepack
zsh: command not found: corepack
We can fix that by doing something along these lines:
Hi @JanJakes, thanks for reporting! This is ultimately a duplicate of #987 (though as you say, the solution likely won't involve needing to install corepack directly). There's a bit of complication around the error messaging, since we want to maintain our helpful error messages and not leave something unhelpful like "Command not found" in the case where we pass-through but don't actually use the underlying corepack shim.
Hi @charlespierce! Thanks for your response. It definitely looks like a related issue, although my scenario maybe adds some more context. The related pull request seems to handle this for the yarn command only but I guess passing commands through to corepack may be a more generic issue that would handle all of the corepack-managed binaries (npm, npx, pnpm, pnpx, yarn, yarnpkg).
I'm also not sure what are the plans for handling this — whether Volta wants to use corepack always when available or if it's up to us users to declare something like "useCorepack": true.
With Corepack included in NodeJS versions 14.19+, 16.19+, and 17+, some of us may want to use Volta for NodeJS version management only and leave package manager binaries to Corepack.
However, that doesn't seem to be doable at the moment as Volta doesn't expose the
corepack
binary, nor those it manages.See an example and a complete reproduction below.
Corepack binary is not exposed:
We can fix that by doing something along these lines:
Now Corepack works:
$ corepack enable
But the binaries Corepack manages are not exposed:
We could fix it again as with Corepack:
Now it works:
But we'd need to do that for all the binaries managed by Corepack (npm, npx, pnpm, pnpx, yarn, yarnpkg), and some of these are already taken by Volta.
Could Volta proxy to the above-mentioned commands by default? I guess it should be an easy fix.
Thanks!
The text was updated successfully, but these errors were encountered: