Skip to content

[BUG] custom viewer ignored in npm help #9828

Description

@marmitar

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

This is not just a request to bump a dependency for a CVE

  • This is not solely a request to bump a dependency for a CVE

Current Behavior

Config viewer is completely ignored, unless it's "browser" or "woman":

let args = ['man', [man]]

Expected Behavior

According to the docs, viewer should be "the program to use to view help content".

viewer: new Definition('viewer', {
default: isWindows ? 'browser' : 'man',
defaultDescription: `
"man" on Posix, "browser" on Windows
`,
type: String,
description: `
The program to use to view help content.
Set to \`"browser"\` to view html help content in the default web browser.
`,
}),

Steps To Reproduce

  1. npm config --global set viewer batman
  2. npm help exec
  3. batman is never invoked

Environment

  • npm: 12.0.1
  • Node.js: v26.5.1
  • OS Name: Arch Linux
  • System Model Name: x86_64
  • npm config:
; "user" config from /home/marmis/.config/npm/npmrc

; cache = "/home/marmis/.cache/npm" ; overridden by env
ignore-scripts = true
; init-module = "/home/marmis/.config/npm/npm-init.js" ; overridden by env
logs-dir = "/home/marmis/.local/state/npm/logs"
min-release-age = 7
viewer = "batman"

; "env" config from environment

cache = "/home/marmis/.cache/npm"
init-module = "/home/marmis/.config/npm/npm-init.js"
userconfig = "/home/marmis/.config/npm/npmrc"

; node bin location = /usr/bin/node
; node version = v26.5.1
; npm local prefix = /home/marmis
; npm version = 12.0.1
; cwd = /home/marmis
; HOME = /home/marmis
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions