0

From this article https://asquera.de/blog/2018-10-01/webassembly-and-wasm-bindgen/ I found we can run wasm-bindgen target/wasm32-unknown-unknown/release/qr_wasm.wasm --out-dir ./dist --no-modules --no-typescript to create wasm and js files without running wasm-pack build (it would install wasm-bindgen regardless if I have previously installed one, making it a bit slow) which seems more flexible to me but when I ran wasm-bindgen xxx it says: zsh: command not found: wasm-bindgen

I googled it but no one seems to have encountered this issue. I also have cargo install wasm-bindgen and wasm-bindgen-cli in my project.

Aero Wang
  • 8,382
  • 14
  • 63
  • 99

3 Answers3

5

Make sure $HOME/.cargo/bin is in your PATH.

If not:

export PATH="$PATH:$HOME/.cargo/bin"

or edit your .bashrc or some other way

bguiz
  • 27,371
  • 47
  • 154
  • 243
Wtfkb
  • 51
  • 1
  • 1
3

I got here from google with the same problem.

My fix was cargo install wasm-bindgen-cli, per here: https://docs.rs/crate/wasm-bindgen/0.2.8

unmzn
  • 31
  • 1
  • 1
0

I installed wasm-bindgen using cargo install wasm-bindgen-cli command, however I wasn't able to execute it.

On Arch, I fixed it with yay -S wasm-bindgen-bin

Marcin
  • 179
  • 2
  • 14