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

Closed
0x2b3bfa0 opened this issue Sep 22, 2021 · 5 comments · Fixed by #5529
Closed

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

0x2b3bfa0 opened this issue Sep 22, 2021 · 5 comments · Fixed by #5529
Labels
Bug thing that needs fixing Documentation documentation related issue 💎 Free Internet Points 💎 similar to "Good First issue" - although more impactful Good First Issue good issue or PR for newcomers

Comments

@0x2b3bfa0
Copy link

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

@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 💎 similar to "Good First issue" - although more impactful Bug thing that needs fixing Documentation documentation related issue Good First Issue good issue or PR for newcomers labels Dec 1, 2021
@Bruce-Hopkins
Copy link

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

@monikasharma1234
Copy link

@darcyclarke Hey , I want to contribute to this issue , can you share me the preferable resources which can help me.

@YashasviChaurasia
Copy link

@darcyclarke I would like to work on this issue.
Thank you

@axelsomerseth
Copy link

I searched about this issue and I found a useful article to understand the context.

I am not asking to work on this issue because I am a macOS user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Documentation documentation related issue 💎 Free Internet Points 💎 similar to "Good First issue" - although more impactful Good First Issue good issue or PR for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants