Fix error Object.keys error

When I have a module with a package.json that has no dependencies
speacified and I do a `npm install {packagename}` there will be
an error thrown in the attempt to suppress a warning message
for global dependencies, which the package.json with no
dependencies does not have.

(Hot)- Fixes #3443