MCPcopy
hub / github.com/electron/forge / checkYarnConfig

Function checkYarnConfig

packages/api/cli/src/util/check-system.ts:71–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69}
70
71async function checkYarnConfig() {
72 const { yarn } = PACKAGE_MANAGERS;
73 const yarnVersion = await spawnPackageManager(yarn, ['--version']);
74 const nodeLinker = await spawnPackageManager(yarn, [
75 'config',
76 'get',
77 'nodeLinker',
78 ]);
79 if (
80 yarnVersion &&
81 semver.gte(yarnVersion, '2.0.0') &&
82 nodeLinker !== 'node-modules'
83 ) {
84 throw new Error(
85 'When using Yarn 2+, `nodeLinker` must be set to "node-modules". Run `yarn config set nodeLinker node-modules` to set this config value, or add it to your project\'s `.yarnrc.yml` file.',
86 );
87 }
88}
89
90// TODO(erickzhao): Drop antiquated versions of npm for Forge v8
91const ALLOWLISTED_VERSIONS: Record<

Callers 1

checkPackageManagerFunction · 0.85

Calls 1

spawnPackageManagerFunction · 0.90

Tested by

no test coverage detected