Pass 'all' as parameter to self.package call in version function
Pass 'all' as parameter to self.package call in version function

Pass 'all' as the parameter to self.package call in version function. If you don't just the latest package.json gets returned, which does not have 'dist-tags' or versions causing error cannot get version of undefined.
doowb/npm-api