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: open
  • Created 2 years ago
  • Reactions: 41
  • Comments: 17

Commits related to this issue

Most upvoted comments

@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 having the same problem on pnpm 8.9.2

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

This is a workaround

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