Manually bring over some changes from 'process' branch intended to help avoid hanging processes under sudo.
  - Use "-n" flag to force immediate exit and failure when launching under sudo with no password if it requires a password, rather than prompting and hanging indefinitely.
  - Pass in a working directory to cleanNPMCache since we run it non-globally (use user home).