My resume website is almost done, I'm just finalizing a "Contact me" form that should send me an e-mail with some plain text.
Here's what it looks like in Jade:
div.contact-email-box
form(id='contact-form' action='/' method='post')
h3 Contact me
div
label
span Name:
input(placeholder='e.g: Mark' type='text' tabindex='1' required autofocus)
div
label
span Email:
input(placeholder='e.g: mark@example.com' type='email' tabindex='2' required)
div
label
span Message:
textarea(tabindex='3' required)
div
button(name='Submit' type='submit' id='contact-submit') Send Email
And here's where I catch the POST
in my server.js
:
var express = require('express')
, app = express()
var nodemailer = require('nodemailer')
app.post('/', function(req, res) {
})
As you can see it does not do anything, yet I receive the following error:
/home/kade_c/website/node_modules/nodemailer/lib/mailer/index.js:31 compile: [(...args) => this._convertDataImages(...args)], ^^^
SyntaxError: Unexpected token ...
That happens only when I require('nodemailer')
even though it is installed correctly to my node_modules
.
Is this a known bug? How may I fix it?