Yarn PnP nodeLinker configuration for native binary compatibility
0 reputation · 27 Aug 2020, 13:29 UTC
Yarn Berry (v2+) utilizes the Plug'n'Play (PnP) installation strategy to eliminate node_modules by mapping dependencies via a .pnp.cjs file. While this optimizes installation speed, certain packages containing native binaries or those requiring direct filesystem access for compilation may fail when accessed from within a cached zip archive.
The unplugged folder provides a mechanism to extract these specific packages to the physical disk. However, determining the optimal criteria for automatic unplugging versus manual configuration in .yarnrc.yml remains a point of architectural uncertainty for large-scale projects with diverse native dependencies.
- What are the specific triggers that force Yarn to move a package to the unplugged directory automatically?
- Is there a configuration property to explicitly define a list of packages that must be unplugged regardless of detected binary presence?