Wait to locate system-installed Node until the shell environment is loaded (#30416)

Release Notes:

- Fixed a race condition that sometimes prevented a system-installed
`node` binary from being detected.
- Fixed a bug where the `node.path` setting was not respected when
invoking npm.
This commit is contained in:
Max Brunsfeld 2025-05-09 12:24:28 -07:00 committed by GitHub
parent 9afc6f6f5c
commit 65b13968a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 68 additions and 58 deletions

View file

@ -397,7 +397,7 @@ pub fn init(cx: &mut App) -> Arc<AgentAppState> {
cx.observe_global::<SettingsStore>(move |cx| {
let settings = &ProjectSettings::get_global(cx).node;
let options = NodeBinaryOptions {
allow_path_lookup: !settings.ignore_system_version.unwrap_or_default(),
allow_path_lookup: !settings.ignore_system_version,
allow_binary_download: true,
use_paths: settings.path.as_ref().map(|node_path| {
let node_path = PathBuf::from(shellexpand::tilde(node_path).as_ref());
@ -417,7 +417,7 @@ pub fn init(cx: &mut App) -> Arc<AgentAppState> {
tx.send(Some(options)).log_err();
})
.detach();
let node_runtime = NodeRuntime::new(client.http_client(), rx);
let node_runtime = NodeRuntime::new(client.http_client(), None, rx);
let extension_host_proxy = ExtensionHostProxy::global(cx);