Conversation
aurreco-uga
pushed a commit
that referenced
this pull request
Jan 9, 2026
* Stop using YARN_IGNORE_PATH env var * README tweak
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: Yarn Version Conflicts Between Dev and Legacy Environments
The Problem
We support two different environments:
Previously, we tried to handle this by:
yarnPath: .yarn/releases/yarn-3.3.1.cjsin.yarnrc.yml(tells Yarn to use the old bundled version)YARN_IGNORE_PATH=1environment variable to override this on dev machinesThis didn't work. Here's why:
yarn nx start, it spawns nested yarn commands (via npm-run-all, nx, etc.)YARN_IGNORE_PATHvariable from these nested processes for securityYARN_NPM_MINIMAL_AGE_GATEsecurity variable and errors out (doesn't recognize it)Result: Dev commands like
yarn nx start @veupathdb/genomics-sitefailed with confusing errors.The Solution
We commented out the
yarnPathline in.yarnrc.ymland added a pre-commit hook to keep it commented.How it works now:
packageManager: "yarn@4.12.0"from package.json)yarnPathline locally (not committed to git)What Changed
Files Modified:
.yarnrc.yml- Commented outyarnPathwith instructionstools/scripts/check-yarnrc-config.sh- New pre-commit hook (blocks uncommenting yarnPath).husky/pre-commit- Added the new validationtools/scripts/check-yarn-lockfile.sh- Updated error messageREADME.adoc- Removed obsoleteYARN_IGNORE_PATHinstructions.envrc.example- RemovedYARN_IGNORE_PATHFor Developers
What You Need to Do:
Remove
YARN_IGNORE_PATHfrom your environmentIf you previously added it to
.bashrc,.zshrc, or.envrc, remove this line:Keep
YARN_NPM_MINIMAL_AGE_GATE(if you had it)This one is still needed and works correctly:
Verify yarn version
After pulling this PR, check:
yarn --version # Should show: 4.12.0Everything should just work
Commands like
yarn nx startshould now work without errors!What If I See Yarn 3.3.1?
If you see version 3.3.1 instead of 4.12.0, you need to enable corepack:
(This is already documented in README.adoc)
For Legacy Deployment Servers
What You Need to Do:
After deploying this code, manually uncomment the
yarnPathline in.yarnrc.yml:Edit
.yarnrc.ymland change:# yarnPath: .yarn/releases/yarn-3.3.1.cjsTo:
DO NOT commit this change!
This modification should stay local to the deployment server. The pre-commit hook will block it anyway.
Before git operations, restore the file:
Then run
git pullorgit checkoutas needed.After git operations, uncomment it again (repeat step 1)
Why This Workflow?
yarnPathcommented in git, dev machines work correctlyTesting Done
yarnPathnpmMinimalAgeGateerrors when running buildsWhy This Matters
For developers: Your build commands will actually work now. No more mysterious Yarn config errors.
For security: Dev machines get the 7-day package age gate (protects against supply chain attacks).
For legacy servers: Nothing breaks - you just have an extra step during deployment (uncomment one line).
Questions?