Non-zero exit code with bad command #4031

ferrouswheel opened this Issue Oct 24, 2013 · 3 comments

3 participants


Npm version 1.3.11

Type npm sperglebergle

Get the help message, cool. But then returns exit code 0. Should really give an non zero exit code if the sperglebergle action doesn't exist.


If you would like to write a patch for this we can merge it.


This landed as 057d9b7:

bauchelain% npm glarb || echo "oh shiiii"

Usage: npm <command>

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

npm <cmd> -h     quick help on <cmd>
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:
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@3.9.0 /Users/ogd/Documents/projects/npm/npm
oh shiiii

Closing as shipped. Thanks for your time!

@othiym23 othiym23 closed this May 20, 2016

See also #4780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment