changes --save to --save-dev for npm module
better error handling