Updated npm error catching.