Safer npm updating, see https://github.com/npm/npm/issues/6247