DEV Community

Discussion on: Creating a basic website with Express.js

Collapse
patrickcole profile image
Patrick Cole • Edited on

Hi Aurel, thanks for posting this great express example. I'm having some issues getting going with the import express from "express" command. When I switch it to a const express = require('express') it seems to work. I believe this is due to the fact that NodeJS does not currently support ES6 import statements, is that correct? Or am I out of date on that thinking? Love the simplicity of this first tutorial and glad I was introduced to pug. It's a pretty cool little module!

Collapse
aurelkurtula profile image
aurel kurtula Author

Yes you are right.

I use babel behind the scenes which allows me to use import. and other ES6 features.

Have you tried cloning the project, it is configured for ES6 features to work

Collapse
patrickcole profile image
Patrick Cole

I had not cloned it yet, but it makes sense now. Thanks for clarifying the 'issue' I was seeing.

Collapse
aurelkurtula profile image
aurel kurtula Author

Patrick, if you are interested, I wrote a tutorial on how I quickly make use of babel (and webpack) to get ES6 working. You can read about it here