Added workaround for Cygwin, npm authors explicitly forbids it:
npm/lib/commands/completion.js
if (isWindowsShell) {
const msg = 'npm completion supported only in MINGW / Git bash on Windows'
throw Object.assign(new Error(msg), {
#!/bin/sh
# http://tldp.org/HOWTO/XWindow-User-HOWTO/runningx.html
if [ -n "$WINDIR" -o "$TERM" = cygwin ]; then
# Probably under Cygwin.
exec XWin -multiwindow -clipboard -silent-dup-error -xkblayout "us,ru" -xkboptions "grp:caps_toggle" "$@"
elif [ -f /etc/debian_version ]; then
exec /usr/bin/X -nolisten tcp "$@"
else
exec X -nolisten tcp "$@"
fi