mise x node@X -- yarn … runs yarn's child processes on a different Node when another version's bin dir is already on PATH #10345
Unanswered
ghprince
asked this question in
Troubleshooting and bug reports
Replies: 1 comment
-
|
Fixed in #10422 (merged) — ships in the next release.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When
PATHalready contains another Node version's install dir (e.g. left over from a snapshotted/frozen environment of a previously activated shell),mise x node@22 -- <cmd>correctly resolves the direct command, but everything that resolvesnodevia PATH inside the process tree (subshells,#!/usr/bin/env nodeshebangs, package managers spawning tools) still gets the other version. The result is a very confusing split-brain:node --versionsays 22, while the process actually running your tests is 24.Environment
yarnshims present in both installsReproduction
Inspecting
PATHinsidemise x node@22 -- sh -c 'echo $PATH'shows why: the pre-existinginstalls/node/24/binentry stays ahead of theinstalls/node/22/binentry thatmise xadds, so everyenv node/ PATH lookup wins for 24, while the literalnodeargument tomise xis resolved against the requested version.Questions
mise x— i.e. is it intentional that a pre-existing tool bin dir on PATH outranks the dirmise xinjects for the requested version? If so, would it be reasonable formise x node@Xto strip or demote other mise-managed install dirs for the same tool from the child PATH?Beta Was this translation helpful? Give feedback.
All reactions