Skip to content
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

Silently fails with n auto when curl and wget aren't installed #649

Closed
Strum355 opened this issue Jan 26, 2021 · 3 comments
Closed

Silently fails with n auto when curl and wget aren't installed #649

Strum355 opened this issue Jan 26, 2021 · 3 comments
Labels

Comments

@Strum355
Copy link

Bug Report

Summary

When running n auto without curl or wget installed, the command exits 1 silently without an error:

root@e5c39cb1f5fa:/workspace# n auto
       found : /workspace/.nvmrc
        read : 14.15.4
  installing : node-v14.15.4
root@e5c39cb1f5fa:/workspace# echo $?
1

Steps to Reproduce

Dockerfile as such:

FROM node:15.6.0-buster-slim

RUN npm install -g n

And run n auto in a repo with a file such as .nvmrc

Expected Behaviour

Some indication as to what the error is, such as when I run n latest I get:

root@e5c39cb1f5fa:/workspace# n latest

  Error: curl or wget command required


  Error: failed to download version index (https://nodejs.org/dist/index.tab)

Actual Behaviour

Silent exits with code 1

Configuration Details

$ n --version
7.0.0

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

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

Reproduced. This happens in general when the version does not need a lookup, like n 10.2.3.

@shadowspawn
Copy link
Collaborator

I think with current usage, this line should not be redirecting stderr:

n/bin/n

Line 853 in 9dad9db

do_get --spider "$1" &> /dev/null || return 1

@shadowspawn
Copy link
Collaborator

Improved behaviour released in version 7.0.1.

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

No branches or pull requests

2 participants