mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-11 17:42:43 -04:00
fix: frozen install with dir deps that have no manifest (#3793)
This commit is contained in:
5
.changeset/six-mice-perform.md
Normal file
5
.changeset/six-mice-perform.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/headless": patch
|
||||
---
|
||||
|
||||
Frozen install should not fail if the lockfile contains references to directories with no `package.json` file.
|
||||
@@ -488,8 +488,13 @@ async function linkRootPackages (
|
||||
if (importerManifestsByImporterId[importerId]) {
|
||||
return importerManifestsByImporterId[importerId]
|
||||
}
|
||||
// TODO: cover this case with a test
|
||||
return await readProjectManifestOnly(packageDir) as DependencyManifest
|
||||
try {
|
||||
// TODO: cover this case with a test
|
||||
return await readProjectManifestOnly(packageDir) as DependencyManifest
|
||||
} catch (err) {
|
||||
if (err['code'] !== 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND') throw err
|
||||
return { name: alias, version: '0.0.0' }
|
||||
}
|
||||
})() as DependencyManifest
|
||||
await symlinkDirectRootDependency(packageDir, opts.importerModulesDir, alias, {
|
||||
fromDependenciesField: isDev && 'devDependencies' ||
|
||||
|
||||
@@ -57,6 +57,11 @@ test('local directory with no package.json', async () => {
|
||||
const expectedSpecs = { pkg: 'link:pkg' }
|
||||
expect(manifest.dependencies).toStrictEqual(expectedSpecs)
|
||||
await project.has('pkg')
|
||||
|
||||
await rimraf('node_modules')
|
||||
|
||||
await install(manifest, await testDefaults({ frozenLockfile: true }))
|
||||
await project.has('pkg')
|
||||
})
|
||||
|
||||
test('local file via link:', async () => {
|
||||
|
||||
Reference in New Issue
Block a user