Handle network failures gracefully
Here is the scenario:
$ np major --yolo
✔ Prerequisite check
✔ Git
✔ Bumping version
✖ Publishing package
Pushing tags
Command failed: npm publish
npm ERR! publish Failed PUT undefined
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/hemanth/.nvm/versions/node/v4.2.1/bin/node" "/Users/hemanth/.nvm/versions/node/v4.2.1/bin/npm" "publish"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND npm.meow.com npm.meow.com:80
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
I fix the proxy and later when I do a np major --yolo it bumps and publishes.
It would be an overhead but worth the trade off, if we check that the previous version before bump was published or handle such case where it might be a network failure and roll-back?
check that the previous version before bump was published
This is a nifty idea. I've definitely gotten myself into situations where I bumped the version multiple times before publishing (or before publishing succeeded), by accident.
So if np detected that the existing package.json version was never published, it would skip bumping the version? Wouldn't --yolo disable this?
Closing due to age. np has since added a rollback feature so these errors aren't so bad anymore