updated to use common.npm() and fixed console pollution

towards fixing #6423