Use "which npm package" instead of literally executing UNIX "which" command
Refactor pre-installation check to use promise pattern