diff --git a/sources/corepackUtils.ts b/sources/corepackUtils.ts index db040bc02..1c235020d 100644 --- a/sources/corepackUtils.ts +++ b/sources/corepackUtils.ts @@ -11,7 +11,6 @@ import {setTimeout as setTimeoutPromise} from 'timers/prom import * as engine from './Engine'; import * as debugUtils from './debugUtils'; import * as folderUtils from './folderUtils'; -import * as fsUtils from './fsUtils'; import * as httpUtils from './httpUtils'; import * as nodeUtils from './nodeUtils'; import * as npmRegistryUtils from './npmRegistryUtils'; @@ -261,7 +260,7 @@ export async function installVersion(installTarget: string, locator: Locator, {s ((err as nodeUtils.NodeError).code === `EPERM` && (await fs.promises.stat(installFolder)).isDirectory()) ) { debugUtils.log(`Another instance of corepack installed ${locator.name}@${locator.reference}`); - await fsUtils.rimraf(tmpFolder); + await fs.promises.rm(tmpFolder, {recursive: true, force: true}); } else { throw err; } diff --git a/sources/fsUtils.ts b/sources/fsUtils.ts deleted file mode 100644 index fc9d14dbc..000000000 --- a/sources/fsUtils.ts +++ /dev/null @@ -1,5 +0,0 @@ -import {rm} from 'fs/promises'; - -export async function rimraf(path: string) { - return rm(path, {recursive: true, force: true}); -}