Skip to content
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

Feature request: Support --cpu and --os flag to specify platform specific install #5152

Closed
archfz opened this issue Jul 12, 2022 · 2 comments

Comments

@archfz
Copy link

archfz commented Jul 12, 2022

Use case

Given the os and cpu package.json attributes, and the rise on usage of optionalDependencies for native modules, and also given cross platform building of certain applications like electron, it would be nice to be able to install npm packages for a given platform, disregarding current platform.

My case is having a thrid party native module using optionalDependencies to install platform specific node bindings. Now this module is bundled together with an electron app, and the build pipeline uses wine to build it for windows as well from debian. The issue is that the thrid party native module will always be installed with linux native bindings.

Proposal

The proposal is to have two extra possible arguments for npm install. --os would specify for what operating system to install packages, --cpu for what cpu. The defaults for these options would be from current platform.

Example: npm i --os win32 --cpu x64

@ljharb
Copy link
Contributor

ljharb commented Jul 12, 2022

feature requests go in https://github.com/npm/rfcs

@archfz archfz closed this as completed Jul 12, 2022
@alex-kinokon
Copy link

RFC Link: npm/rfcs#612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants