microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 102 forks source link

Improved error logging in case when the user specified module can not be loaded #155

Closed slavafomin closed 4 years ago

slavafomin commented 4 years ago

Right now, dts-gen tries to load the user specified module and looks for MODULE_NOT_FOUND errors. When such error is caught it instruct the user to install the specified module (thinking that the specified module is not actually installed).

However, in situations where the specified module can't be correctly loaded due to the missing dependency, the error message becomes wrong: it suggests to install the specified module, however it is already installed.

This PR makes the error message more clear by telling exactly what dependency failed to load and suggests to install it.

This should correctly fix #86, which was closed without a proper fix.

msftclas commented 4 years ago

CLA assistant check
All CLA requirements met.

orta commented 4 years ago

Thanks, yeah, this is a good call 👍

jucasoft commented 4 years ago

this fix is not present in the npm library, when do you plan to publish it? I opened the run.js file and I have the old code. I try to edit it locally.

Mihaiii commented 3 years ago

The change still isn't in the npm library. Also opened run.js file and changed it with this fix.