napi-rs / node-rs

Node.js bindings ❤️ Rust crates
https://node-rs.dev
MIT License
1.12k stars 32 forks source link

Unsupported platform for @node-rs/argon2-wasm32-wasi@1.8.0: wanted {"cpu":"wasm32"} (current: {"cpu":"x64"}) #810

Closed davidyuk closed 6 months ago

davidyuk commented 6 months ago

I'm getting the above error trying to install this package as

npm i @node-rs/argon2-wasm32-wasi

it works if I add --force flag

npm i @node-rs/argon2-wasm32-wasi --force

The problem is https://github.com/napi-rs/node-rs/blob/ee3defdfa60eb8b9da692d0b92387e513c3acb81/packages/argon2/npm/wasm32-wasi/package.json#L4-L6 It is not set correctly, because wasm actually can be executed on x64 and other platforms. I think the best would be to omit cpu key at all. NPM version I'm using is 10.2.4.

https://docs.npmjs.com/cli/v10/configuring-npm/package-json#cpu

Brooooooklyn commented 6 months ago

npm i @node-rs/argon2-wasm32-wasi --cpu=wasm32, see https://github.com/napi-rs/napi-rs/issues/1794 and https://github.com/napi-rs/node-rs/issues/792 for the context

davidyuk commented 6 months ago

Sounds good to me. I'm planning to use this package in our sdk, will report if I have any other issues. Thank you!