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.

3 Answers 3

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

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.