我想使用email-templates package與nodemailer結合使用,但是我得到的模板文件不存在錯誤。我已經嘗試了絕對的相對路徑,都無濟於事。最後,我決定嘗試讓示例工作,但仍然沒有運氣。下面是我做的:nodemailer node-email-templates,沒有這樣的文件或目錄錯誤
下載和提取的node-email-templates-master zip文件和:
我收到同樣的錯誤作爲前:
fs.js:338
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT, no such file or directory '../header/html.ejs'
at Object.fs.openSync (fs.js:338:18)
at fs.readFileSync (fs.js:182:15)
at Object.exports.parse (/mypath/node-email-templates-master/node_modules/ejs/lib/ejs.js:159:19)
at exports.compile (/mypath/node-email-templates-master/node_modules/ejs/lib/ejs.js:222:15)
at Object.exports.render (/mypath/node-email-templates-master/node_modules/ejs/lib/ejs.js:273:10)
at EmailTemplate.render (/mypath/node-email-templates-master/lib/main.js:63:16)
at Render.batch (/mypath/node-email-templates-master/examples/nodemailer/index.js:118:9)
at /mypath/node-email-templates-master/examples/nodemailer/index.js:126:16
at fs.stat.batchCheck (/mypath/node-email-templates-master/lib/main.js:130:18)
我運行的節點版本0.8.12
安裝包裝通過:
npm install email-templates
和執行的示例文件:
node node_modules/email-templates/examples/nodemailer/index
給出了同樣的錯誤。有沒有人可以幫助我讓電子郵件模板啓動並運行? TNX!
我沒有使用Windows,所以這不可能是問題 – DivZero