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] npm publish complains on bin field examples from npm docs #7302

Open
2 tasks done
mrazauskas opened this issue Mar 20, 2024 · 1 comment
Open
2 tasks done

[BUG] npm publish complains on bin field examples from npm docs #7302

mrazauskas opened this issue Mar 20, 2024 · 1 comment
Labels
Bug thing that needs fixing Documentation documentation related issue Priority 2 secondary priority issue Release 10.x

Comments

@mrazauskas
Copy link

mrazauskas commented Mar 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

npm publish complains and auto correct the bin field examples from npm docs.

Expected Behavior

Seems like the examples are correct, there is no need to complain or alter the code.

Steps To Reproduce

First example:

  1. Create fresh repo with npm init -y
  2. Add dummy file cli.js
  3. Copy bin field entry from npm docs to package.json:
"bin": {
  "myapp": "./cli.js"
}

Second example:

  1. Create fresh repo with npm init -y
  2. Add dummy file cli.js
  3. Copy bin field entry from npm docs to package.json:
"bin": "./cli.js"

Finally run npm publish --dry-run. In both cases npm complains:

npm WARN publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm WARN publish errors corrected:
npm WARN publish "bin[myapp]" script name was cleaned

Environment

  • npm: 10.2.4
  • Node.js: 20.11.1
  • OS Name: macOS
  • System Model Name: Macbook Pro
  • npm config:
; "user" config from /Users/(replaced)/.npmrc

//registry.npmjs.org/:_authToken = (protected) 

; node bin location = /Users/(replaced)/.n/bin/node
; node version = v20.11.1
; npm local prefix = /Users/(replaced)/Projects/x-npm-bin
; npm version = 10.2.4
; cwd = /Users/(replaced)/Projects/x-npm-bin
; HOME = /Users/(replaced)
; Run `npm config ls -l` to show all defaults.
@mrazauskas mrazauskas added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Mar 20, 2024
@milaninfy milaninfy added Documentation documentation related issue Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Mar 21, 2024
@trivikr
Copy link

trivikr commented Mar 26, 2024

Related: npm/package-json#83

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 Priority 2 secondary priority issue Release 10.x
Projects
None yet
Development

No branches or pull requests

3 participants