Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Misleading documentation on package.json:bin #3788

Open
0x2b3bfa0 opened this issue Sep 22, 2021 · 2 comments
Open

[BUG] Misleading documentation on package.json:bin #3788

0x2b3bfa0 opened this issue Sep 22, 2021 · 2 comments
Labels
Bug Documentation 💎 Free Internet Points 💎 Good First Issue

Comments

@0x2b3bfa0
Copy link

@0x2b3bfa0 0x2b3bfa0 commented Sep 22, 2021

What / Why

Documentation states the following:

To use this, supply a bin field in your package.json which is a map of command name to local file name. When this package is installed globally, that file will be linked where global bins go so it is available to run by name. (quote from the documentation)

Unfortunately, this is not true for Windows, where it doesn't use symbolic links, but rather a custom script generated by the cmd-shim package.

When

  • running npm install

Where

How

Steps to Reproduce

main.js

const [, file, ...parameters] = process.argv;
console.log(require('path').basename(file));

package.json

{
  "bin": {
    "one": "main.js",
    "two": "main.js"
  }
  ···
}

Current Behavior

Running one will print main.js on Windows and one on every other platform.

Expected Behavior

Running one should print one on every platform.

@MylesBorins
Copy link
Contributor

@MylesBorins MylesBorins commented Sep 23, 2021

@0x2b3bfa0 this particular documentation is actually tracked in the CLI repository and checked in to this repository via automation. I'm going to transfer this issue to the appropriate repository

@MylesBorins MylesBorins transferred this issue from npm/documentation Sep 23, 2021
@darcyclarke darcyclarke added 💎 Free Internet Points 💎 Bug Documentation Good First Issue labels Dec 1, 2021
@Bruce-Hopkins
Copy link

@Bruce-Hopkins Bruce-Hopkins commented Dec 29, 2021

Is this still an issue? Can I pick this up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Documentation 💎 Free Internet Points 💎 Good First Issue
Projects
None yet
Development

No branches or pull requests

4 participants