small test speed up

don’t actually do an npm install when it’s output isn’t tested. Instead only test that the npm install task is called.
misc cleanup
Merge pull request #2684 from stefanpenner/reduce-npm-calls-during-tests

test cleanup
use ui.writeError in lib/cli/cli.js

fixes GH-2254
Merge pull request #2342 from fivetanley/use-ui-write-in-cli

use ui.writeError in lib/cli/cli.js
WIP