Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-09-08 19:50:33 +0300
committerGitHub <noreply@github.com>2022-09-08 19:50:33 +0300
commit2e9280072f9852466fa0944d3a0fdb0c8af156a9 (patch)
tree7c3144280321988ce120a738a7d37c4643fc2668 /lib
parent412cbabc64f8a94a8bd85c562b12c908295264db (diff)
feat: remove `npm bin` (#5459)
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 https://github.com/npm/statusboard/issues/537
Diffstat (limited to 'lib')
-rw-r--r--lib/commands/bin.js23
-rw-r--r--lib/utils/cmd-list.js1
2 files changed, 0 insertions, 24 deletions
diff --git a/lib/commands/bin.js b/lib/commands/bin.js
deleted file mode 100644
index 9ba3cb400..000000000
--- a/lib/commands/bin.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const log = require('../utils/log-shim.js')
-const BaseCommand = require('../base-command.js')
-// TODO this may not be needed at all. Ignoring because our tests normalize
-// process.env.path already
-/* istanbul ignore next */
-const path = process.env.path || process.env.Path || process.env.PATH
-const { delimiter } = require('path')
-
-class Bin extends BaseCommand {
- static description = 'Display npm bin folder'
- static name = 'bin'
- static params = ['global']
- static ignoreImplicitWorkspace = true
-
- async exec (args) {
- const b = this.npm.bin
- this.npm.output(b)
- if (this.npm.global && !path.split(delimiter).includes(b)) {
- log.error('bin', '(not in PATH env variable)')
- }
- }
-}
-module.exports = Bin
diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js
index 38439542a..4dca7df2d 100644
--- a/lib/utils/cmd-list.js
+++ b/lib/utils/cmd-list.js
@@ -74,7 +74,6 @@ const cmdList = [
'access',
'adduser',
'audit',
- 'bin',
'bugs',
'cache',
'ci',