MCPcopy
hub / github.com/prisma/prisma / wipeCacheAndRetry

Method wipeCacheAndRetry

packages/cli/src/SubCommand.ts:113–122  ·  view source on GitHub ↗
(pkgWithVersion: string, prefix: string)

Source from the content-addressed store, hash-verified

111 }
112
113 private async wipeCacheAndRetry(pkgWithVersion: string, prefix: string): Promise<Runnable> {
114 // Wipe cache and retry if import fails
115 rmSync(prefix, { recursive: true })
116 const modulePath = await this.installPackage(pkgWithVersion, prefix)
117 try {
118 return await import(modulePath)
119 } catch (e) {
120 throw new ImportError(e)
121 }
122 }
123
124 private async installPackage(pkgWithVersion: string, prefix: string) {
125 const npmCachedModulePath = pathToFileURL(join(prefix, 'node_modules', this.pkg, 'dist', 'index.js')).toString()

Callers 1

importPackageMethod · 0.95

Calls 2

installPackageMethod · 0.95
rmSyncFunction · 0.85

Tested by

no test coverage detected