Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function remove (p: string) {
removalLogger.debug(p)
return rimraf(p)
}
await Promise.all(orphanDepPaths.map(async (orphanDepPath) => {
const pathToRemove = path.join(opts.virtualStoreDir, orphanDepPath, 'node_modules')
removalLogger.debug(pathToRemove)
try {
await vacuum(pathToRemove, {
base: opts.virtualStoreDir,
purge: true,
})
} catch (err) {
logger.warn({
error: err,
message: `Failed to remove "${pathToRemove}"`,
prefix: opts.lockfileDir,
})
}
}))
}