test: simplify common.run() to common.npm()
cache: Handle 404s and other HTTP errors as errors

Fix #4982