forwardemail/email-templates

Cannot find module '../images/url-rewriter'

Closed this issue · 5 comments

i try to run the example and i got this:

Error: Cannot find module '../images/url-rewriter'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/zhenjielee/Downloads/projects/backend-microservice-user-lambda/node_modules/clean-css/lib/imports/inliner.js:4:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/zhenjielee/Downloads/projects/backend-microservice-user-lambda/node_modules/clean-css/lib/clean.js:14:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

i have already installed the npm modules using yarn

Try to force a npm install or yarn install.

I'm getting the same thing.... but only with yarn. What do you mean by "Try to force a npm install or yarn install"?

I haven't investigated further but I suspect this has to do with the version of juice this package is using (2.0.0) which is now at version 4.1.0 which depends on web-resource-inliner (2.0.0 which is now at 4.1.0) which uses clean-css (1.1.7 which is now at 4.1.3) which is causing the problem.

Sure enough... if I clone this repo, upgrade juice to 4.1.0, and link the clone into my project it works fine. Also, all test pass using juice 4.1.0. I see there's already a PR to upgrade juice to 3.0.1 (and juice is now at 4.1.0). Is there a reason to not upgrade juice ?

See v2.6.0 on NPM. Thank you @hburrows

npm install --save email-templates@latest