npm login fails on git bash

PROBLEM:

in git bash for windows, when I try “npm login” I get this:

$ npm login
npm notice Log in on https://registry.npmjs.org/
Login at:
https://www.npmjs.com/login?next=/login/cli/xxxx
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>
npm error A complete log of this run can be found in: C:\Users\userXYZ\AppData\Local\npm-cache\_logs\xxx-debug-0.log

FIX:

run npm login in “windows command terminal” instead. After that, all npm publish-related commands run OK in git-bash.

CAUSE:

maybe has something to do with npm login opening a browser window for authenication.