kuno/npm-zsh-completion — Issue #3: NPM completion behavior has changed
Author: castFromVoidPtr
Created: 2012-01-11 22:12:40+00:00
State: open

I'm not sure when this happened, but it looks like NPM's `completion` subcommand has "gotten smarter" and broken your script in the process. Right now, it produces gobbledygook, because `npm completion` outputs a shell script instead of a list of completion options. This script is supposed to be sourced or appended to the user's shell startup files (it contains logic to determine whether it's running in bash or zsh, and behaves accordingly).

That script in turn calls out to `npm completion` according to a new set of rules. The following is from the `npm-completion` man page:

> When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the environment, `npm completion` acts in "plumbing mode", and outputs completions based on the arguments.

Your script could be adapted to use this calling convention. Then again, it might not be worth bothering.