Wasm-pack: pack error on Windows 10 17746

Created on 31 Aug 2018  ·  15Comments  ·  Source: rustwasm/wasm-pack

🐛 Bug description

I just try the hello world on my computer.
Project structure is

default

wasm-pack init is success
default

but wasm-pack pack . is faild
default

wasm-pack.log

Aug 31 10:21:31.981 INFO Running pack command...
Aug 31 10:21:31.982 INFO Path: Some(".")
Aug 31 10:21:31.982 INFO Packing up the npm package...
Aug 31 10:21:31.982 ERRO 系统找不到指定的文件。 (os error 2)

🤔 Expected Behavior

No error occurred

👟 Steps to reproduce

  1. create new hello world project
  2. wasm-pack init
  3. wasm-pack pack .

🌍 Your environment

os: windows 10 x64 17746.1000
wasm-pack version: 0.4.2
rustc version: 1.30.0-nightly (02cb8f2a4 2018-08-29)

bug changelog - fix user report

Most helpful comment

All 15 comments

Thanks for the bug report!

@WangZishi I suspect that npm wasn't installed on your machine, could you paste the npm meta info here?


@fitzgen
anyway, pack cmd invokes npm directly https://github.com/rustwasm/wasm-pack/blob/89be40df2f478a19b9fdd38dafdc7792967560f2/src/npm.rs#L10-L18
maybe better to add a binary exsit_or_not checking as you did in test PR here?

That sounds good to me! We should probably always do that, just to get good error messages to users

@csmoe I do have npm and node installed on my machine.
default

ah @WangZishi what happens when you run wasm-pack pack (without the dot?). the dot shouldn't cause an issue but it may be...

@ashleygwilliams
and it has the same output.
default

what else can I help?

hrm. thanks so much for the response and sorry this is taking so long to figure out. @steveklabnik do you think you could try this locally?

I get

C:\Users\steve> wasm-pack pack

| 🎒  packed up your package!

this bug can be reproduced with Chinese-ver Windows7 in my virtualbox, comparing to stevelabnik's comment, I suspect that system locale is the one to be blamed.

Unfortunately, this issue affects login, pack, and publish on Windows!

I verified that the cause suggested by @luotaoyeah is indeed occurring. Command places "npm" in quotes when calling it, which causes it to fail in Windows only.

The recommended solution is to call npm using cmd /c. I am working on a PR for this and have verified the cmd /c solution works. Unfortunately, it requires some OS-specific code -- but it seems unavoidable.

@danwilhelm are you on discord or IRC? feel free to reach out to me on either platfrom (i'm ag_dubs)

closed by #489! about to go out!

@WangZishi @csmoe I was not able to test my commit on Chinese-ver Windows! Could you possibly verify whether it is fixed in wasm-pack 0.6.0?

@danwilhelm thanks for the fix. I'll test then(my locale gussing maybe almost not the cause).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsheard picture jsheard  ·  4Comments

turboladen picture turboladen  ·  4Comments

Outpox picture Outpox  ·  4Comments

tbillington picture tbillington  ·  3Comments

pablosichert picture pablosichert  ·  4Comments