fix: don't print a warning when printing packages globally (#8529)

close #4761
This commit is contained in:
Zoltan Kochan
2024-09-16 01:09:31 +02:00
committed by GitHub
parent a987579876
commit e50baa8458
2 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/core": patch
"pnpm": patch
---
Don't print a warning when linking packages globally [#4761](https://github.com/pnpm/pnpm/issues/4761).

View File

@@ -1333,8 +1333,10 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => {
const projectToInstall = projects[index]
if (opts.global && projectToInstall.mutation.includes('install')) {
projectToInstall.wantedDependencies.forEach(pkg => {
if (!linkedPackages?.includes(pkg.alias)) {
logger.warn({ message: `${pkg.alias ?? pkg.pref} has no binaries`, prefix: opts.lockfileDir })
// This warning is never printed currently during "pnpm link --global"
// due to the following issue: https://github.com/pnpm/pnpm/issues/4761
if (pkg.alias && !linkedPackages?.includes(pkg.alias)) {
logger.warn({ message: `${pkg.alias} has no binaries`, prefix: opts.lockfileDir })
}
})
}