fix(npm): local nodeModulesDir was sometimes resolving duplicates of same package (#23320)

This commit is contained in:
David Sherret 2024-04-11 13:18:19 -04:00 committed by GitHub
parent 061bcb5393
commit df73db671b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 5 deletions

View file

@ -522,6 +522,8 @@ impl NpmResolver for ManagedCliNpmResolver {
let path = self
.fs_resolver
.resolve_package_folder_from_package(name, referrer, mode)?;
let path =
canonicalize_path_maybe_not_exists_with_fs(&path, self.fs.as_ref())?;
log::debug!("Resolved {} from {} to {}", name, referrer, path.display());
Ok(path)
}