[BUG] OS specific module breaks workspace installation #6138
Labels
config:workspace
related to `--workspace`
Priority 2
secondary priority issue
Release 9.x
work is associated with a specific npm 9 release
ws:arborist
Related to the arborist workspace
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When workspace config contains a package that requests an specific os/cpu, if current platform doesn't match that requirement, npm will panic and throw 'EBADPLATFORM' error.
Currently we can't mark a workspace package "optional" in any ways. In order to finish the installation process, we need to use "--force" flag.
Packages that need to build sub n-api platform-specific packages like esbuild face this issue.
Expected Behavior
Let npm have a config to consider a workspace package "optional".
One method to archive that is using optionalDependencies config:
Or add another config like the peerDependenciesMeta:
Steps To Reproduce
For example:
When trying to run npm install on an different platform, error like below will be thrown:

Environment
unrelated
The text was updated successfully, but these errors were encountered: