-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add --cpu
and --os
option to override platform specific install
#6755
Conversation
--cpu
and --os
option to override platform specific install --cpu
and --os
option to override platform specific install
Can you rebase your branch against |
Once #6756 lands would you be willing to make a new PR to the |
@wraithgar It seems that already based on currnet
|
12b892f
to
6faf1f7
Compare
I've rebased again |
Does the test fail because it's just flaky or the diff may contain something wrong? It passed on my local machine |
The test failed cause of an engines mismatch, we need to bump the config module's CI and engines. Disregard, and thank you for seeing this through the multiple modules it took to implement. I know a lot of folks would appreciate this landing in |
@wraithgar Sure, created #6776 |
@yukukotani (cc @wraithgar) this is rad! A question about intended behavior on this feature:
Thank you! Tested with npm 10.2.3 |
Yes, this is intentional as all of these are optional dependencies, and missing an optional dependency is never an error state. For 1, this is input validation which would need to happen in the config declaration. Off the top of my head I don't know what the valid set of parameters would be. For 2, this is a job for |
Add
--cpu
option and---os
option which is proposed in npm/rfcs#612.The change of npm-install-checks package is here: npm/npm-install-checks#65
Real Example
Let's think about the package.json below:
Running
npm i
on my M1 mac machine will install two package@node-rs/xxhash
and@node-rs/xxhash-darwin-arm64
.Running
npm i --cpu x64 --os freebsd
will install@node-rs/xxhash-freebsd-x64
instead of@node-rs/xxhash-darwin-arm64
.References
Closes npm/rfcs#612