-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore(yarn): Add package.json#packageManager field #9523
chore(yarn): Add package.json#packageManager field #9523
Conversation
I have hit this issue as well, working around it by doing |
@felix unless there are other ways to install Volta, I think you should have lines either in .zshrc or .bashrc like this: # VOLTA
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH" To disable Volta, I'm commenting out those lines and opening a new shell session. |
If there is no downside to volta usage, then this seems reasonable. Perhaps we could abandon volta completely and align with corepack if that is an official replacement? We do have CI tasks that use a volta github action, would that need changing to use corepack instead? Tangentially, I might be wrong, but it seems to me that a lot of projects are moving from yarn to pnpm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be pinned in the website
and any other package.json
where volta is in use. yarn
threw an error in hubble.gl when packageManager
was missing in website
, which is yarn 1, since the top level project was pinned to yarn 4.
The two versions currently match in deck, but they can evolve separately as long as they're defined in multiple places.
It does seem that corepack is what Yarn recommends. I've been happy enough with that combination in other projects. The CI would just need to run I share your impression that a lot of projects have moved to pnpm recently, but I don't have any direct experience with that.
Ouch! It would be nice to reach a stage where we have Yarn workspaces (or pnpm workspaces) configured so that we can avoid skew in yarn and dependency versions. But for now, I agree pinning it in |
486ad09
to
1a149ea
Compare
Once Yarn v2+ has been installed locally in a development environment, it comes with Corepack as the preferred way to install package managers. However, Volta (if installed) silently and globally disables Corepack...
corepack enable
exits successfully (exit code 0), but isn't actually enabled nodejs/corepack#507 (comment)volta install corepack
doesn't provide corepack'syarn
volta-cli/volta#987... which has caused some confusing bugs when the wrong version of Yarn is used, installing a different dependency chain locally vs. CI, and then we get different behaviors in each. To avoid that, I have to disable Volta when working in projects that use Corepack, and to re-enable Volta when working in deck.gl or luma.gl.
Would others be OK with including the
package.json#packageManager
field here, and (if so) in other vis.gl projects? The advantage would be that we get the right version of Yarn whether we're using Volta or Corepack, as long as we keep both entries pinned to the same version.Or' if this isn't an issue for anyone else, I can keep enabling/disabling Volta as needed, not the end of the world. :)