Skip to content

should not network curl index.tab when using numeric .node-version #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
loynoir opened this issue Aug 21, 2024 · 3 comments
Closed

should not network curl index.tab when using numeric .node-version #812

loynoir opened this issue Aug 21, 2024 · 3 comments

Comments

@loynoir
Copy link

loynoir commented Aug 21, 2024

Bug Report

should not network curl index.tab when using numeric .node-version

Summary

should not network curl index.tab when using numeric .node-version

Steps to Reproduce

$ echo 22.6.0 > .node-version

Expected Behaviour

Everytime command install or exec using numeric .node-version, should not network curl index.tab.

Actual Behaviour

Everytime command install using numeric .node-version, network curl index.tab.

$ bash -x `which n` install auto |& grep index.tab 
++ local index_url=https://nodejs.org/dist/index.tab
++ do_get_index https://nodejs.org/dist/index.tab
++ curl --silent --location --fail --show-error --silent https://nodejs.org/dist/index.tab

Everytime command exec using numeric .node-version, network curl index.tab.

$ bash -x `which n` exec auto node --version |& grep index.tab
++ local index_url=https://nodejs.org/dist/index.tab
++ do_get_index https://nodejs.org/dist/index.tab
++ curl --silent --location --fail --show-error --silent https://nodejs.org/dist/index.tab

Other Information

Configuration Details

$ n --version
v9.2.3

$ command -v node
/usr/local/bin/node

$ node -p process.platform
linux
@shadowspawn
Copy link
Collaborator

Nice reproduction steps, thanks.

The way auto and engine are implemented does not currently benefit from the fast-path for fully specified numeric version specified on command-line.

Performance has become of more interest since we added exec and run, since they are lightweight compared with an install.

@shadowspawn
Copy link
Collaborator

(You can avoid the network call manually by adding --offline, but this issue identifies an improvement for the default behaviour.)

@shadowspawn
Copy link
Collaborator

Improved in v10.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants