nodeshift-archived / license-reporter

license-reporter is a tool that gathers licenses for project's dependencies and produces a output in XML, JSON, YAML and HTML format.
Apache License 2.0
13 stars 10 forks source link

error when the project has node_modules but has no dependencies declared #238

Closed helio-frota closed 6 years ago

helio-frota commented 6 years ago

https://github.com/bucharest-gold/roi has no dependencies.

✔ ~/Desktop/roi [master|✚ 1] 
15:10 $ license-reporter console
TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at usingVersionRange (/home/hf/Desktop/license-reporter/lib/modules/messages.js:12:38)
    at Object.show (/home/hf/Desktop/license-reporter/lib/modules/messages.js:40:3)
    at Object.transform (/home/hf/Desktop/license-reporter/lib/modules/console.mdl.js:77:12)
    at checker.check.then (/home/hf/Desktop/license-reporter/lib/commands/console.cmd.js:62:47)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
helio-frota commented 6 years ago

We need to check if the project has dependencies https://github.com/bucharest-gold/license-reporter/blob/master/lib/modules/console.mdl.js#L77

helio-frota commented 6 years ago

So maybe is good just show a message for save, console and report commands: "No dependencies found." or something.

helio-frota commented 6 years ago

landed https://github.com/bucharest-gold/license-reporter/commit/6670df2cb9d987ad41ee6c51d2fbb613c407d3e0