Skip to content

wasm-pack login confusing error message without npm installed #1541

@saghm

Description

@saghm

🐛 Bug description

Running wasm-pack login gave a confusing error message that seems to be directly returning a std::io::Error from opening some file without any additional context (e.g. which file it's trying to open, why it needs to try to open a file, etc.):

Error: No such file or directory (os error 2)
Caused by: No such file or directory (os error 2)

🤔 Expected Behavior

I was able to figure out that this was because I didn't have npm installed. I'd expect that the error message printed would indicate more clearly what file wasn't found (i.e. an npm executable somewhere on the users PATH) rather than forwarding the underlying I/O error directly.

👟 Steps to reproduce

  1. Uninstall npm (or use a machine/container/environment that doesn't have it already)
  2. Run wasm-pack login

🌍 Your environment

wasm-pack version: 0.13.1 (via https://archlinux.org/packages/extra/x86_64/wasm-pack/)
rustc version: probably irrelevant (given that I installed a binary version?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions