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 pkg help output does not show an example for setting array values #4320

Closed
2 tasks done
bnb opened this issue Jan 24, 2022 · 1 comment · Fixed by #4424
Closed
2 tasks done

[BUG] npm pkg help output does not show an example for setting array values #4320

bnb opened this issue Jan 24, 2022 · 1 comment · Fixed by #4424
Labels
Bug thing that needs fixing Documentation documentation related issue Priority 2 secondary priority issue Release 8.x work is associated with a specific npm 8 release

Comments

@bnb
Copy link
Contributor

bnb commented Jan 24, 2022

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

At present, it doesn't seem like the npm pkg --help output provides sufficient context for end-users to understand that they can also set array values with it, despite this feature being fully available (see the docs).

I personally ran into this trying to use npm pkg set to define my workspaces.

Here's the current output:

❯ npm pkg --help                     
npm pkg

Manages your package.json

Usage:
npm pkg set <key>=<value> [<key>=<value> ...]
npm pkg get [<key> [<key> ...]]
npm pkg delete <key> [<key> ...]

Options:
[-f|--force] [--json]
[-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
[-ws|--workspaces]

Run "npm help pkg" for more info

Expected Behavior

Ideally, this output would reflect the ability to set array values.

Steps To Reproduce

  1. run npm pkg --help

Environment

  • npm: 8.3.1
  • Node.js: v17.4.0
  • OS Name: WSL2/Ubuntu
  • System Model Name:
  • npm config:
; "user" config from /home/bnb/.npmrc

//registry.npmjs.org/:_authToken = (protected) 
init-author-email = "hello@bnb.im" 
init-author-license = "" 
init-author-name = "Tierney Cyren" 
init-author-url = "https://bnb.im/" 
init-license = "MIT" 
init-version = "0.0.1" 
init.version = "1.0.0" 
loglevel = "notice" 

; node bin location = /home/bnb/.nvm/versions/node/v17.4.0/bin/node
; cwd = /home/bnb/GitHub/cutenode/enginesync
; HOME = /home/bnb
; Run `npm config ls -l` to show all defaults.```
@bnb bnb added Bug thing that needs fixing Needs Triage needs review for next steps Release 8.x work is associated with a specific npm 8 release labels Jan 24, 2022
@ruyadorno ruyadorno added Priority 2 secondary priority issue Documentation documentation related issue and removed Needs Triage needs review for next steps labels Jan 26, 2022
manekinekko added a commit to manekinekko/cli that referenced this issue Feb 16, 2022
Add example for setting array values

Fixes npm#4320
manekinekko added a commit to manekinekko/cli that referenced this issue Feb 16, 2022
Add example for setting array values

Fixes npm#4320
manekinekko added a commit to manekinekko/cli that referenced this issue Feb 16, 2022
wraithgar pushed a commit that referenced this issue Feb 16, 2022
Add example for setting array values
Fixes #4320
@manekinekko
Copy link
Contributor

Fix landed in 9275856.

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 8.x work is associated with a specific npm 8 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants