Npm install is breaking my apps

How to deal with situations when some npm packages won’t install with 4.* version of npm (4.6.1, to be precise). For example: firebase.

Is there work around for this?

Firebase installs fine with latest 5.* npm version.
My stackoverflow question.