Getting ES6/ES7 to work in the terminal

Want to try out new ES6/ES7 features like async/await in your terminal? Already have nodejs installed but can’t get it to work? Don’t worry there is a really quick fix to get it to work. There are only two simple things you need to do. First you need to upgrade to the latest node version (6.9 when this post was published). Next you run node with the –harmony flag:

node --harmony myscript.js

You will get all the fancy ES6/ES7 features you need. The –harmony flags tells node to enable all the experimental features that haven’t yet made it to the stable node version.