You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Use case
Given the
os
andcpu
package.json attributes, and the rise on usage ofoptionalDependencies
for native modules, and also given cross platform building of certain applications likeelectron
, 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 anelectron
app, and the build pipeline useswine
to build it for windows as well from debian. The issue is that the thrid party native module will always be installed withlinux
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
The text was updated successfully, but these errors were encountered: