Skip to content

Commit

Permalink
feat: remove npm bin (npm#5459)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this removes the `npm bin` command

The output of this command is misleading and incomplete.  The `.bin`
resolution of npm is much more nuanced than this command implies, and
the output of `npm bin` is not something end users should be dealing
with.  `npm` itself is responsible for running the `bin` entries of
modules, with the exception of global bins, which end up in the same
folder as `node` itself, presumably already in a user's path since they
can run node.

Closes npm/statusboard#537
  • Loading branch information
wraithgar committed Sep 8, 2022
1 parent 412cbab commit 2e92800
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 87 deletions.
23 changes: 0 additions & 23 deletions lib/commands/bin.js

This file was deleted.

1 change: 0 additions & 1 deletion lib/utils/cmd-list.js
Expand Up @@ -74,7 +74,6 @@ const cmdList = [
'access',
'adduser',
'audit',
'bin',
'bugs',
'cache',
'ci',
Expand Down
2 changes: 1 addition & 1 deletion smoke-tests/tap-snapshots/test/index.js.test.cjs
Expand Up @@ -21,7 +21,7 @@ npm help npm more involved overview
All commands:
access, adduser, audit, bin, bugs, cache, ci, completion,
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
Expand Down
1 change: 0 additions & 1 deletion tap-snapshots/test/lib/commands/completion.js.test.cjs
Expand Up @@ -47,7 +47,6 @@ Array [
access
adduser
audit
bin
bugs
cache
ci
Expand Down
12 changes: 0 additions & 12 deletions tap-snapshots/test/lib/load-all-commands.js.test.cjs
Expand Up @@ -57,18 +57,6 @@ Options:
Run "npm help audit" for more info
`

exports[`test/lib/load-all-commands.js TAP load each command bin > must match snapshot 1`] = `
Display npm bin folder
Usage:
npm bin
Options:
[-g|--global]
Run "npm help bin" for more info
`

exports[`test/lib/load-all-commands.js TAP load each command birthday > must match snapshot 1`] = `
Birthday, deprecated
Expand Down
18 changes: 4 additions & 14 deletions tap-snapshots/test/lib/npm.js.test.cjs
Expand Up @@ -21,7 +21,7 @@ npm help npm more involved overview
All commands:
access, adduser, audit, bin, bugs, cache, ci, completion,
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
Expand Down Expand Up @@ -57,7 +57,7 @@ npm help npm more involved overview
All commands:
access, adduser, audit, bin, bugs, cache, ci, completion,
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
Expand Down Expand Up @@ -93,7 +93,7 @@ npm help npm more involved overview
All commands:
access, adduser, audit, bin, bugs, cache, ci, completion,
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
Expand Down Expand Up @@ -129,7 +129,7 @@ npm help npm more involved overview (in a browser)
All commands:
access, adduser, audit, bin, bugs, cache, ci, completion,
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
Expand Down Expand Up @@ -211,16 +211,6 @@ All commands:
Run "npm help audit" for more info
bin Display npm bin folder
Usage:
npm bin
Options:
[-g|--global]
Run "npm help bin" for more info
bugs Report bugs for a package in a web browser
Usage:
Expand Down
4 changes: 1 addition & 3 deletions tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
Expand Up @@ -30,8 +30,7 @@ Object {
"auth": "author",
"autho": "author",
"author": "author",
"bi": "bin",
"bin": "bin",
"b": "bugs",
"bu": "bugs",
"bug": "bugs",
"bugs": "bugs",
Expand Down Expand Up @@ -418,7 +417,6 @@ Object {
"access",
"adduser",
"audit",
"bin",
"bugs",
"cache",
"ci",
Expand Down
32 changes: 0 additions & 32 deletions test/lib/commands/bin.js

This file was deleted.

0 comments on commit 2e92800

Please sign in to comment.