Skip to content

[BUG] npm help config fails with "Cannot read property '1' of null" #4610

Closed
@d0sboots

Description

@d0sboots

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

Here's the relevant error:

29 verbose stack TypeError: Cannot read property '1' of null
29 verbose stack at /nobackup/usr/share/nodejs/npm/lib/commands/help.js:65:49
29 verbose stack at Array.sort ()
29 verbose stack at Help.exec (/nobackup/usr/share/nodejs/npm/lib/commands/help.js:63:17)
29 verbose stack at async module.exports (/nobackup/usr/share/nodejs/npm/lib/cli.js:66:5)

The full log, slightly scrubbed for privacy:

0 verbose cli [ '/nobackup/usr/bin/node', '/usr/bin/npm', 'help', 'config' ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/nobackup/usr/share/nodejs/npm/npmrc Completed in 5ms
6 timing config:load:builtin Completed in 5ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/home/davedude/public_html/ConjunctionJunction/.npmrc Completed in 1ms
10 timing config:load:project Completed in 5ms
11 timing config:load:file:/home/davedude/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 15ms
19 timing npm:load:configload Completed in 16ms
20 timing npm:load:setTitle Completed in 0ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:display Completed in 4ms
23 verbose logfile /home/XXX/.npm/_logs/YYY-debug-0.log
24 timing npm:load:logFile Completed in 5ms
25 timing npm:load:timers Completed in 0ms
26 timing npm:load:configScope Completed in 0ms
27 timing npm:load Completed in 25ms
28 timing command:help Completed in 17ms
29 verbose stack TypeError: Cannot read property '1' of null
29 verbose stack at /nobackup/usr/share/nodejs/npm/lib/commands/help.js:65:49
29 verbose stack at Array.sort ()
29 verbose stack at Help.exec (/nobackup/usr/share/nodejs/npm/lib/commands/help.js:63:17)
29 verbose stack at async module.exports (/nobackup/usr/share/nodejs/npm/lib/cli.js:66:5)
30 verbose cwd /home/XXX/YYY
31 verbose Linux 5.9.0-5-amd64
32 verbose argv "/nobackup/usr/bin/node" "/usr/bin/npm" "help" "config"
33 verbose node v12.22.10
34 verbose npm v8.5.5
35 error Cannot read property '1' of null
36 verbose exit 1
37 timing npm Completed in 161ms
38 verbose code 1
39 error A complete log of this run can be found in:
39 error /home/XXX/.npm/_logs/YYY-debug-0.log

Expected Behavior

I get help for the config sub-command.

Steps To Reproduce

  1. In Debian (possibly Ubuntu or others), install npm using dpkg. The important thing here is that it's installed via the system package manager, and thus using the system man directories.
  2. Install openssl. This package owns the manpage "man5/config.5ssl.gz".
  3. Run npm help config
  4. Receive error

Environment

  • npm: 8.5.5
  • Node.js: v12.22.10
  • OS Name: Debian testing
  • System Model Name: Linux 5.9.0-5-amd64 x86_64
  • npm config: (lightly scrubbed for privacy)
; "builtin" config from /nobackup/usr/share/nodejs/npm/npmrc

globalignorefile = "/etc/npmignore"
prefix = "/usr/local"

; node bin location = /nobackup/usr/bin/node
; cwd = /home/XXX/YYY
; HOME = /home/XXX

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions