wasm-pack does not find installed wasm-bindgen

Created on 16 Sep 2018  路  10Comments  路  Source: rustwasm/wasm-pack

馃悰 Bug description

On MacOS, wasm-pack will always take 4 to 5 minutes to run, stopping at the "[7/8] Installing wasm-bindgen..." stage.

馃 Expected Behavior

wasm-pack should use an existing wasm-bindgen install instead of redownloading every time.

馃憻 Steps to reproduce

On a Mac, install wasm-pack, NPM, the wasm rustc backend, and cargo-generate.
Run the following commands:

cargo generate --git https://github.com/rustwasm/wasm-pack-template

In the generated project, run:

wasm-pack init
rm -rf pkg
wasm-pack init

Both runs of wasm-pack will take the same time.

馃實 Your environment

Late 2015 MacBook Pro
MacOS High Sierra v10.13.6
wasm-pack version: 0.4.2
rustc version: 1.30.0-nightly

bug duplicate user report

Most helpful comment

I had the exact same issue before. The easiest way to fix is setting the patch version. e.g. wasm-bindgen = "0.2.19"

The wasm-bindgen version has to match the one you have installed exactly. You have a wasm-bindgen v 0.2.19 or something installed, and it is matching on 0.2, so it always fails the check.

There is a little blurb with more explanation on the issue:
https://github.com/rustwasm/wasm-pack/issues/272

All 10 comments

What version of wasm-bindgen is shown in your Cargo.toml?

@xmclark

[dependencies]
wasm-bindgen = "0.2"

I had the exact same issue before. The easiest way to fix is setting the patch version. e.g. wasm-bindgen = "0.2.19"

The wasm-bindgen version has to match the one you have installed exactly. You have a wasm-bindgen v 0.2.19 or something installed, and it is matching on 0.2, so it always fails the check.

There is a little blurb with more explanation on the issue:
https://github.com/rustwasm/wasm-pack/issues/272

ideally, when https://github.com/rustwasm/wasm-pack/issues/270 is fixed (there is an open PR right now for it) this will also be fixed. our next release is blocked until that PR lands- but hopefully we should be able to get it done this week. sorry you ran into this @pcstl and thanks @xmclark for helping respond! super appreciate you both 馃

Hey, I changed the version in my Cargo.toml to wasm-bindgen = "0.2.21" (which is the same version as the CLI I have installed) and it still does a full install every time. The problem here does not seem to be what you are assuming it to be.

@pcstl wasm-pack will do a full install everytime to ensure that the correct version exists. if you are sure you have the correct version you can run the command with --no-installs and avoid the installation steps. verison 0.5.0 will mitigate all of this, hopefully we can release it this week.

Hi Ashley,

thanks for the help, but if I try using --no-installs it says this argument was not expected. I'm on wasm-pack 0.4.2 right now.

For what it's worth, I'm just doing a cargo build and copying stuff into the right places so I can get a decent edit-build loop time. The reason I was using wasm-pack init for this is that the Rust + WASM tutorial tells users to use wasm-pack for building.

@pcstl it's -m no-install, not --no-install (when in doubt, run --help for a full listing of flags)

@fitzgen I see. Thanks. I had ran --help, but since -m was hidden down there in the OPTIONS section and no-install was even further hidden in the description for -m, I didn't figure it out at first. It might be a nice UX change to make the no-install option more visible.

this should be solved by the latest 0.5.0 release, closing. if it is not fixed please comment with more details and i will reopen!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbillington picture tbillington  路  3Comments

turboladen picture turboladen  路  4Comments

rpjohnst picture rpjohnst  路  5Comments

gliheng picture gliheng  路  3Comments

rbtcollins picture rbtcollins  路  3Comments