pnpm: pnpm link --global for a dependency with a bin prints unexpected warning

pnpm version 7.1.1

Take a project with a simple file at bin/command.mjs

#!/usr/bin/env node

console.log("hello world");

Configure it via the bin field of that project’s package.json file.

  "bin": { "myCommand": "./bin/command.mjs" }

Install this local project globally.

pnpm link --global

Unexpected output:

 WARN  undefined has no binaries

The associated bin file is available as expected despite this warning.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 48
  • Comments: 25 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Still happening in 9.1.1

@zkochan I tested this on v8.15.2 and it doesn’t seem to be fixed. I’m still seeing the same warning as before. In my case it prints:

 WARN  link:<path-to-package> has no binaries

I’m using workspaces, my package has a name and it’s private. Maybe this helps debug the issue further.

Still happening in 9.7.1. Apologies for the +1, this is relatively urgent for me.

Still having the same problem on pnpm 8.9.2

pnpm install -g "name@link:$(pwd)"

This is a workaround

although I unlinked the package from the list, the package was visible . so uninstalling and linking it again does not give an error https://pnpm.io/cli/unlink

check it pnpm list --global

uninstall pnpm uninstall --global <package>

link again pnpm link --global

Still happening in 8.15.5

This is STILL happening, and has been happening for close to a year now. This hinders the development of local cli tools in NodeJS.

same problem 💢

Same issue. Latest pnpm 8.10.0 and node 20.9.0 w/ npm 10.1.0

🚢 9.11

@zkochan Same issue still present on 9.10.0

yep. 9.10 released on Sep 9, 2024. fix done on Sep 16, 2024. so no release with fix yet.