wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

cargo wasm-pack install does not work on aarch64

Open alphaqu opened this issue 2 years ago • 3 comments

🐛 Bug description

I want to install wasm-pack on my server which runs an arm64/aarch64 CPU. The installer does not work so I did cargo install wasm-pack. It compiles but when I run npm install -g wasm-pack or yarn global add wasm-pack it fails.

🤔 Expected Behavior

It registers to the system and does not crash npm.

👟 Steps to reproduce

  • cargo install wasm-pack
  • sudo npm install -g wasm-pack
/usr/bin/wasm-pack -> /usr/lib/node_modules/wasm-pack/run.js

> [email protected] postinstall /usr/lib/node_modules/wasm-pack
> node ./install.js

/usr/lib/node_modules/wasm-pack/binary.js:20
  throw new Error(`Unsupported platform: ${type} ${arch}`);
  ^

Error: Unsupported platform: Linux arm64
    at getPlatform (/usr/lib/node_modules/wasm-pack/binary.js:20:9)
    at getBinary (/usr/lib/node_modules/wasm-pack/binary.js:24:20)
    at install (/usr/lib/node_modules/wasm-pack/binary.js:38:18)
    at Object.<anonymous> (/usr/lib/node_modules/wasm-pack/install.js:4:1)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-03-28T07_32_10_760Z-debug.log

🌍 Your environment

Include the relevant details of your environment. wasm-pack version: 0.10.2 rustc version: 1.59.0

alphaqu avatar Mar 28 '22 07:03 alphaqu

https://github.com/rustwasm/wasm-pack/pull/1102

frewsxcv avatar Mar 28 '22 22:03 frewsxcv

https://github.com/rustwasm/wasm-pack/pull/1122

frewsxcv avatar Mar 28 '22 22:03 frewsxcv

I'm not sure this issue will be resolved by #1122, since that PR fixes the the download one-liner script. This seems to be triggered by a JS error, so the download logic must be duplicated there.

I could port the same fix to JS as a part of the original MR (it would still be in the spirit of it), because this has come to bite me a second time.

omninonsense avatar Apr 26 '22 10:04 omninonsense

Fixed in v0.11.0.

drager avatar Mar 19 '23 18:03 drager