Skip to content

Commit 0fe8f12

Browse files
true0rdevelar
authored andcommitted
fix(app-builder-lib): yarn install break on 'electron-builder install-app-deps' when used pnp (#4147)
Plug’n’Play https://yarnpkg.com/en/docs/pnp
1 parent fc85a42 commit 0fe8f12

File tree

1 file changed

+10
-1
lines changed
  • packages/app-builder-lib/src/util

1 file changed

+10
-1
lines changed

packages/app-builder-lib/src/util/yarn.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@ export async function installOrRebuild(config: Configuration, appDir: string, op
1212
buildFromSource: config.buildDependenciesFromSource === true,
1313
additionalArgs: asArray(config.npmArgs), ...options
1414
}
15+
let isDependenciesInstalled = false
1516

16-
if (forceInstall || !(await pathExists(path.join(appDir, "node_modules")))) {
17+
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
18+
if (await pathExists(path.join(appDir, fileOrDir))) {
19+
isDependenciesInstalled = true
20+
21+
break
22+
}
23+
}
24+
25+
if (forceInstall || !isDependenciesInstalled) {
1726
await installDependencies(appDir, effectiveOptions)
1827
}
1928
else {

0 commit comments

Comments
 (0)