-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.2.0 Error: Cannot find module 'debug' #292
Comments
+1 |
1 similar comment
+1 |
I've just had to pin to 4.1.0 to prevent this breaking my project build. |
+1 |
Thanks for the heads up everyone, I'll take a look at this today. cc @mrfelton |
I can not reproduce this. Is the fix to move the |
@thinkingserious I could reproduce this:
However this "fixed" it:
Do you possibly have |
Additionally, yes, that would fix it - the debug is being used in the production code, and not part of something like a build toolchain that isn't required to be used in production applications. |
I just checked and it was not installed globally. Everyone, It looks like I just need to either move that dependency to Does anyone have a preference? |
Just to double check there were no other issues, I did the following
|
@thinkingserious Sorry for all the double posts, we appear to have commented at the same time. I don't have a preference between those two, as long as we can use your package without it breaking our production build. We might find it useful to be able to enable logging of this kind, although having quickly grep'd for |
If debug is only used for ..ehrm debugging in dev I would prefer to not have it as a regular dependency. thx for all the checking @peterchoo |
Would you want those messages in a production environment? This is where I'm conflicted. Perhaps it should be optional? It seems like those messages would be good to log in production, but the name of the package suggests it would be used only for debugging. |
I think that if you want to have debug included with sendgrid, you would need to decide if you need any more specific types of message. Have a read of https://www.npmjs.com/package/debug if you haven't yet, in a simple example using However if you had a particular section of your code, such as the contacts importer that introduced this issue and had If you wish to use this functionality, it becomes a dependency. It will not affect people using the sendgrid package unless they have //Edit I'm in favour of you adding the debug package as a dependency, and gradually improving the debug logging. It will not be a massive increase in size, or affect the running of your code. It will not affect me as a user unless I enable it. It would be a useful tool if I have any issues in the future. |
After reading the arguments from @peterchoo I changed my mind. I support adding debug as a regular dependency as well. |
Great! I'll make the fix today. It will be v4.2.1 |
Fixed: https://github.com/sendgrid/sendgrid-nodejs/releases/tag/v4.2.1 Thanks again for all the great feedback 👍 |
Issue Summary
debug is listed as a dev-dependency. As a result you'll get an error if you install this module from npm
Steps to Reproduce
$ npm i sendgrid
$ node
> const sg = require('sendgrid')
returns this result
Technical details:
The text was updated successfully, but these errors were encountered: