Use Volta to manage Node and Yarn version #933
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, I noticed that you upgraded Yarn to v3. So, I tried to upgrade it here in my environment as well and I noticed two problems:
yarn build
to failThen I noticed as well that the GitHub workflows were still using Yarn v1, and thus were re-generating the
yarn.lock
during build (which should not happen).This refactors the logic to use Volta. I use Volta to manage the Node and NPM/Yarn versions of my projects since Volta 1.0 was released, and I never looked behind. It's blazing fast, you don't even notice how fast it downloads either node or yarn when you enter in a project that uses it.
So, this ensures all environments are using the same version of Node and Yarn. When you want to upgrade to some newer version of both, you can run:
volta pin node@18 yarn@3
That will update package.json with the up-to-date version of both.