Skip to content

Commit cf0ac45

Browse files
authored
fix(yarn): check for dependencies in both projectDir and appDir during installation (electron-userland#9219)
fix electron-userland#6448 In a workspace setup, the `node_modules` inside the app directory often doesn't exist, while the one in the project directory does. Therefore, we can add an additional check to verify the existence of `node_modules` in the project directory.
1 parent e375149 commit cf0ac45

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/rude-donuts-bathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix(yarn): check for dependencies in both projectDir and appDir during installation

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function installOrRebuild(config: Configuration, { appDir, projectD
2121
let isDependenciesInstalled = false
2222

2323
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
24-
if (await pathExists(path.join(appDir, fileOrDir))) {
24+
if ((await pathExists(path.join(projectDir, fileOrDir))) || (await pathExists(path.join(appDir, fileOrDir)))) {
2525
isDependenciesInstalled = true
2626

2727
break

0 commit comments

Comments
 (0)