diff --git a/bin/omarchy-npx-install b/bin/omarchy-npx-install index e64b9660..c23c2650 100755 --- a/bin/omarchy-npx-install +++ b/bin/omarchy-npx-install @@ -29,19 +29,21 @@ fi node_bin="\$node_root/bin/node" npx_bin="\$node_root/bin/npx" -# Resolve the package bin inside npx, then run it with node@latest without leaking node@latest into PATH. +# Resolve the package bin inside npx, then run it with node@latest available for node shebangs. # Some wrappers are aliases, e.g. playwright-cli wraps the playwright bin. +"\$node_bin" "\$npx_bin" --yes --prefer-online --package "\$package" -- true + package_bin_path=\$("\$node_bin" "\$npx_bin" --yes --package "\$package" -- which "\$package" 2>/dev/null) if [[ -n \$package_bin_path ]]; then - exec "\$node_bin" "\$package_bin_path" "\$@" + PATH="\$node_root/bin:\$PATH" exec "\$package_bin_path" "\$@" fi # Scoped packages like @openai/codex expose an unscoped bin like codex. package_bin_path=\$("\$node_bin" "\$npx_bin" --yes --package "\$package" -- which "\$command" 2>/dev/null) if [[ -n \$package_bin_path ]]; then - exec "\$node_bin" "\$package_bin_path" "\$@" + PATH="\$node_root/bin:\$PATH" exec "\$package_bin_path" "\$@" fi echo "Could not resolve npm bin for \$package / \$command" >&2