Cli: [BUG] npm 7.x does not output correct error in all cases

Created on 11 Aug 2020  路  2Comments  路  Source: npm/cli

Current Behavior:

when an unknown command is passed there is no output

$ npm i-g citgm

$

Expected Behavior:

When an unknown command is passed the help output should be provided

[citgm][npm-7]$ npm i-g citgm

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    /Users/mylesborins/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

[email protected] /Users/mylesborins/.nvm/versions/node/v14.8.0/lib/node_modules/npm

Steps To Reproduce:

A couple different commands seem to reproduce this

$ npm init-y

$ npm i-g citgm

$ npm cache-add

$ npm what-what-what-what

perhaps it is related to the kebab case?

Environment:

OS: MacOS 10.15.6
Node: 14.7.0
npm: 7.0.0-beta.4

Bug Release 7.x

All 2 comments

Expected Behavior:

npm should output No results for "..."

tested again in v7.0.0-beta.12 and looks like this has been fixed

Was this page helpful?
0 / 5 - 0 ratings