3b1699b59527ee8095397b9909a37d55689a0481

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

npx: deprecate plugin

Fixes #9366

Diff

 1diff --git a/plugins/npx/README.md b/plugins/npx/README.md
 2index 1c052930bb0aff06cc677baeaa7c6eef8bb457d7..41e4c1352f4551207a2e467a8767d655ae43a35f 100644
 3--- a/plugins/npx/README.md
 4+++ b/plugins/npx/README.md
 5@@ -1,21 +1,15 @@
 6 # NPX Plugin
 7-> npx(1) -- execute npm package binaries. ([more info](https://github.com/zkat/npx))
 8 
 9-This plugin automatically registers npx command-not-found handler if `npx` exists in your `$PATH`.
10+> npx(1) -- execute npm package binaries. ([more info](https://github.com/npm/npx))
11 
12-## Setup
13+This plugin automatically registers npx command-not-found handler if `npx` exists in your `$PATH`.
14 
15-- Add plugin to `~/.zshrc`
16+To use it, add `npx` to the plugins array in your zshrc file:
17 
18-```bash
19+```zsh
20 plugins=(.... npx)
21 ```
22 
23-- Globally install npx binary (npx will be auto installed with recent versions of Node.js)
24-```bash
25-sudo npm install -g npx
26-```
27-
28 ## Note
29 
30 The shell auto-fallback doesn't auto-install plain packages. In order to get it to install something, you need to add `@`:
31@@ -29,3 +23,17 @@ Started
32 
33 It does it this way so folks using the fallback don't accidentally try to install regular typoes.
34 
35+## Deprecation
36+
37+Since npm v7, `npx` has been moved to `npm exec`. With the move, [the `--shell-auto-fallback` argument
38+for `npx` has been removed](https://github.com/npm/cli/blob/v7.0.0/docs/content/cli-commands/npm-exec.md#compatibility-with-older-npx-versions):
39+
40+> Shell fallback functionality is removed, as it is not advisable.
41+
42+When using npm v7, you'll get this error:
43+
44+> npx: the --shell-auto-fallback argument has been removed
45+
46+If you get this error, just disable the plugin by removing it from the plugins array in your zshrc file.
47+This plugin will no longer be maintained and will be removed in the future, when the older `npx` versions
48+are no longer available.