Fixes issues with invalid package.json files.
A better solution for attempting to parse package.json files. The
previous release would only test that the package.json file has data,
this release attempts to parse the file's contents if there is data
and writes out a warning if the file data is invalid rather than
crashing.
Thanks to @premosystems