Skip to content

Commit f9eac26

Browse files
committed
Clear out node_modules more
1 parent 30c1354 commit f9eac26

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/commands/fix/pnpm-fix.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ export async function pnpmFix(
141141
continue
142142
}
143143
// eslint-disable-next-line no-await-in-loop
144-
actualTree = await getActualTree(cwd)
144+
await Promise.all([
145+
removeNodeModules(cwd),
146+
...(isRepo ? [gitHardReset(cwd)] : [])
147+
])
148+
// eslint-disable-next-line no-await-in-loop
149+
actualTree = await install(pkgEnvDetails, { spinner })
145150

146151
const oldVersions = arrayUnique(
147152
findPackageNodes(actualTree, name)
@@ -175,7 +180,12 @@ export async function pnpmFix(
175180
vulnerableVersionRange
176181
} of infos) {
177182
// eslint-disable-next-line no-await-in-loop
178-
actualTree = await getActualTree()
183+
await Promise.all([
184+
removeNodeModules(cwd),
185+
...(isRepo ? [gitHardReset(cwd)] : [])
186+
])
187+
// eslint-disable-next-line no-await-in-loop
188+
actualTree = await install(pkgEnvDetails, { spinner })
179189

180190
const node = findPackageNode(actualTree, name, oldVersion)
181191
if (!node) {

0 commit comments

Comments
 (0)