Repository navigation
Description
Summary
Inside a shell spawned by bb, bare node, npm, and npx fail with Volta's "Node is not available" error, even though Volta is correctly configured with a default Node. Every #!/usr/bin/env node script fails the same way — including bb's own $BB_CLI entrypoint.
Cause
bb is installed as a Volta package, so Volta sets _VOLTA_TOOL_RECURSION=1 in bb's environment as its re-entrancy guard. bb passes that environment through to spawned agent shells, so every command in the session inherits it.
Volta's built-in runtime shims treat that variable as "this is a recursive call, do not re-evaluate the platform" (run/node.rs, same pattern in npm.rs, npx.rs, pnpm.rs, yarn.rs):
// Don't re-evaluate the platform if this is a recursive call
let platform = match env::var_os(RECURSION_ENV_VAR) {
Some(_) => None,
None => Platform::current(session)?,
};With platform = None, execution_context falls through to System::path(), which strips Volta's own directories from PATH, and returns ErrorKind::NoPlatform. On a machine where Node is installed only through Volta there is no system Node left to fall back to, so the pass-through fails and Volta prints "Node is not available".
So the failure needs two ingredients: the leaked recursion guard, and no non-Volta Node on PATH. The error text is misleading in this situation — it recommends volta install node, which succeeds and changes nothing, because the install was never missing.
Reproduction
In a bb agent shell on a machine where Volta manages Node:
$ node --version
Volta error: Node is not available.
To run any Node command, first set a default version using `volta install node`
$ env -u _VOLTA_TOOL_RECURSION node --version
v25.0.0
Volta is healthy in that same shell, which is what makes the error misleading:
$ volta list | head -1
runtime [email protected] (default)
$ volta which node
~/.volta/tools/image/node/25.0.0/bin/node
That it is pass-through rather than a resolution failure can be shown directly — with the guard still set, giving the shim a real Node on PATH succeeds:
$ echo $_VOLTA_TOOL_RECURSION
1
$ PATH=~/.volta/tools/image/node/25.0.0/bin:$PATH node --version
v25.0.0
Scope
Only Volta's built-in runtime shims are affected — node, npm, npx — plus any #!/usr/bin/env node script. Package shims keep working, because they resolve through DefaultBinary::from_name and use the platform saved in the package's bin config at install time, never consulting the current/default platform (run/binary.rs). In practice pnpm, codex, and ~/.volta/bin/bb all run normally.
This bites bb specifically: $BB_CLI points at host-daemon/dist/bb, which is an #!/usr/bin/env node script, so it fails, while ~/.volta/bin/bb works. bb also prepends that dist directory as the first PATH entry, so bare bb resolves to the env-node copy rather than the Volta shim and fails too. The net effect is that an agent cannot invoke the bb CLI by any of the obvious routes.
Expected
A shell spawned by bb should behave like a normal user shell — bare node resolves through Volta's default platform.
Suggested fix
Strip _VOLTA_TOOL_RECURSION from the environment bb passes to spawned agent shells.
There is direct precedent in Volta itself: it removes the same variable before volta run for exactly this reason (run/mod.rs) — "Remove the recursion environment variable so that the context is correctly re-evaluated". A spawned agent shell is a new context in the same sense, so clearing the inherited value does not weaken the guard where it genuinely applies.
Workaround
Prefix affected commands with env -u _VOLTA_TOOL_RECURSION, or unset _VOLTA_TOOL_RECURSION in the shell profile.
Environment
- bb 0.37.0
- Volta 2.0.2 (source references above are tag
v2.0.2) - Node 25.0.0 (Volta default), no system Node outside Volta
- macOS, Darwin 25.5.0, zsh
Activity
gsathya commentedon Aug 13, 2026
Correcting the mechanism in the original description, which I had wrong on one point.
I first wrote that the shim skips default-platform resolution and therefore cannot find Node. The skip is real, but the consequence is not a resolution failure: with
platform = None, Volta falls through toSystem::path(), which strips Volta's own directories fromPATH, and returnsErrorKind::NoPlatform. It is a pass-through to system Node. The error surfaces only because this machine has no Node outside Volta, so there is nothing to pass through to.That is demonstrable with the guard still set:
So the trigger needs both the leaked recursion guard and the absence of a non-Volta Node on
PATH. The description now cites the actual code paths inv2.0.2.The request is unchanged, and there is precedent for it in Volta itself: it removes this same variable before
volta run, commented "Remove the recursion environment variable so that the context is correctly re-evaluated" (crates/volta-core/src/run/mod.rs, lines 57-60). A spawned agent shell is a new context in that same sense.SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1545.html
volta run(removes the same var because a new command is a new context). No wire change, no protocol bump. Verified: repro test flips from fail to pass and the same Claude Code turn prints v24.19.0 while the daemon still carries the guard. Optional hardening: also drop it in bb-app cr…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).SawyerHood commentedon Aug 18, 2026
Closing out since volta is no longer maintained