diff --git a/e2e/core/test_node_slow b/e2e/core/test_node_slow index 2719ec95e0..41537c2e79 100644 --- a/e2e/core/test_node_slow +++ b/e2e/core/test_node_slow @@ -14,6 +14,8 @@ mise settings set idiomatic_version_file_enable_tools node mise i node@lts/hydrogen mise i -f node +hydrogen_path="$(mise where node@lts/hydrogen)" +assert "mise x node@$corepack_version -- $hydrogen_path/bin/npm config get prefix" "$hydrogen_path" assert_contains "mise x node@lts/hydrogen -- node --version" "v18." assert "mise x -- node --version" "v$corepack_version" assert_contains "mise x -- which yarn" "yarn" diff --git a/src/plugins/core/assets/node_npm_shim b/src/plugins/core/assets/node_npm_shim index 02cd4dc1e0..be87b1b21d 100755 --- a/src/plugins/core/assets/node_npm_shim +++ b/src/plugins/core/assets/node_npm_shim @@ -69,12 +69,13 @@ should_reshim() { wrap_npm_if_reshim_is_needed() { local npm_cli="$plugin_dir/lib/node_modules/npm/bin/npm-cli.js" + local node_bin="$plugin_dir/bin/node" if should_reshim "$@"; then - node "$npm_cli" "$@" + "$node_bin" "$npm_cli" "$@" printf "Reshimming mise %s...\n" "$plugin_name" >&2 mise reshim else - exec node "$npm_cli" "$@" + exec "$node_bin" "$npm_cli" "$@" fi }