Closed perry-mitchell closed 6 years ago
Reinstall node_modules and/or reinstall node. This does not seem to be related to this package since this package does not use underscore directly.
Ok, I can try that, but npm install is run properly each time.
Why close the issue so soon?
This does not seem to be related to this package since this package does not use underscore directly.
@niftylettuce How can you be so sure? It only occurs when I install this module, and only when I require it. Otherwise there is no error with my application. Clean install of Node 10 on Ubuntu.
I cleared everything, destroyed the container, and I still get this:
There seems to be some issue with this library and it's dependency. Running npm-why
I get this:
So it is clearly a dependency of this library.
Well thanks for the overwhelming support. I'll find another library.
I need a little more time to respond, I will re-open this, sorry I work full time and manage a team and then some, keeping up with open source is hard. I think what I'll do is update that dependency to a newer version of underscore or switch it to lodash and see if that fixes issue.
On Thu, Sep 20, 2018, 2:58 PM Perry Mitchell notifications@github.com wrote:
Well thanks for the overwhelming support. I'll find another library.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/niftylettuce/email-templates/issues/323#issuecomment-423313108, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf7haJ3CPQenqxeYtX4t6uo9TK5SliCks5uc_N-gaJpZM4WytYQ .
Are you still getting this error? Would love to hear back. I haven't had anyone with a similar report and we've updated a few things in the project.
yes i can confirm it does still exists.
email-templates / node / npm versions? Have a stacktrace?
"node": "14.13.1",
"npm": "6.14.8"
Error: Cannot find module 'underscore'
Require stack:
- E:\source\hypetraq\node_modules\underscore.deep\underscore.deep.js
- E:\source\hypetraq\node_modules\country-language\index.js
- E:\source\hypetraq\node_modules\@ladjs\i18n\index.js
- E:\source\hypetraq\node_modules\email-templates\lib\index.js
- E:\source\hypetraq\src\common\mail\mailer.js
- E:\source\hypetraq\src\web\controllers\frontend\page\page.js
- E:\source\hypetraq\src\web\routes\frontend\page.js
- E:\source\hypetraq\src\web\routes\frontend\frontend.js
- E:\source\hypetraq\src\web\routes\routes.js
- E:\source\hypetraq\src\web\server.js
- E:\source\hypetraq\src\web\app.js
Do you by chance have underscore in your devDependencies and it's getting cleaned up?
nope, have been using lodash for a long time never used underscore within my projects.
Your error message is about underscore.deep
. This may either be due to you using underscore.deep
directly in your project (separate from this package require) or it's an issue with country-language
, which has underscore.deep
as a dependency, which is in turn a dependency of i18n-locales
. I'm guessing you're on an old version of npm, yarn, or something is cached and its not installing all the deps recursively.
i'm not using any of those packages you mention directly on my project.
email-templates -> "@ladjs/i18n": "^6.0.0", i18n: -> "country-language": "^0.1.7", country-language -> "underscore.deep": "~0.5.1"
Nobody else seems to have this issue. Can you try rm -rf node_modules yarn.lock
and also npm cache clear --force
or yarn cache clean
? What version of npm or yarn are you running? What version of Node? If you wipe your node_modules dir and also clear your package manager cache, then reinstall with npm install
should be good.
Seems that upon installing
email-templates
andpug
, by importingemail-templates
I get the following error:The code I'm using is quite simple:
__transport
is a Nodemailer transport instance:I'm running this on Node 10 in a docker container. Everything installs fine, but I get that error when I try to run that code. I'm using Nodemailer v4.6.8 and email-templates v5.0.0.