wasm-pack: pack error on Windows 10 17746

๐Ÿ› 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)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

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

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

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.