Generally speaking, only tools that matter to the current process should be injected to the PATH. For example, running node ... should only add .volta/tools/image/node/22.13.1/bin to the PATH, not .volta/tools/image/yarn/1.22.19/bin. This last path should only be added to the PATH once the yarn shim is actually called.
The reason for that is that until the Yarn shim is called, Volta doesn't know whether it would ever be called. For example on my system only Node is managed by Volta on some projects, with the global yarn binary coming from another source, let's say /path/to/my/yarn. Unfortunately when calling execFile from within Node the Volta Yarn is unexpectedly called because Volta force-injected the shim.
As a workaround for this issue users can remove the yarn field from the ~/.volta/tools/user/platform.json file - this will prevent Volta from finding a path for Yarn, and thus to add it into the PATH.
Generally speaking, only tools that matter to the current process should be injected to the PATH. For example, running
node ...should only add.volta/tools/image/node/22.13.1/binto the PATH, not.volta/tools/image/yarn/1.22.19/bin. This last path should only be added to the PATH once theyarnshim is actually called.The reason for that is that until the Yarn shim is called, Volta doesn't know whether it would ever be called. For example on my system only Node is managed by Volta on some projects, with the global
yarnbinary coming from another source, let's say/path/to/my/yarn. Unfortunately when callingexecFilefrom within Node the Volta Yarn is unexpectedly called because Volta force-injected the shim.As a workaround for this issue users can remove the
yarnfield from the~/.volta/tools/user/platform.jsonfile - this will prevent Volta from finding a path for Yarn, and thus to add it into the PATH.