Fix the ugly npm install errors.

Here you go @jrgm and @jbonacci 

Only install the automation-tests deps if AUTOMATION_TESTS=true is defined on the command line.

fixes #3160