Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ctx.existsWantedLockfile &&
ctx.wantedLockfile.lockfileVersion === LOCKFILE_VERSION &&
await pEvery(ctx.importers, async (importer) =>
!hasLocalTarballDepsInRoot(ctx.wantedLockfile, importer.id) &&
satisfiesPackageManifest(ctx.wantedLockfile, importer.manifest, importer.id) &&
linkedPackagesAreUpToDate(importer.manifest, ctx.wantedLockfile.importers[importer.id], importer.rootDir, opts.workspacePackages)
)
)
) {
if (!ctx.existsWantedLockfile) {
if (ctx.importers.some((importer) => pkgHasDependencies(importer.manifest))) {
throw new Error(`Headless installation requires a ${WANTED_LOCKFILE} file`)
}
} else {
logger.info({ message: 'Lockfile is up-to-date, resolution step is skipped', prefix: opts.lockfileDir })
await headless({
currentEngine: {
nodeVersion: opts.nodeVersion,
pnpmVersion: opts.packageManager.name === 'pnpm' ? opts.packageManager.version : '',
},
currentLockfile: ctx.currentLockfile,
engineStrict: opts.engineStrict,
extraBinPaths: opts.extraBinPaths,
force: opts.force,
hoistedAliases: ctx.hoistedAliases,
hoistPattern: ctx.hoistPattern,
ignoreScripts: opts.ignoreScripts,
importers: ctx.importers as Array<{
binsDir: string,
buildIndex: number,
id: string,
manifest: ImporterManifest,