V
V
Vitaly2016-01-26 13:29:48
JavaScript
Vitaly, 2016-01-26 13:29:48

How to make EcmaScript 6 work with node js?

I still don’t understand how you can write code in ES6 so that it works with a node.
Even react starter kit (server) can't start

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kerim Berdimyradov, 2016-01-26
@berdimuradov

try compiling ES6 to ES5 using grunt+babel.
Maybe this article will help
Babel + Grunt === ES6 Now!

D
Dmitry Belyaev, 2016-02-03
@bingo347

Обновите ноду до версии 4.х (стабильное ядро v8) или 5.х (самое свежее ядро v8)

J
Jon Doe, 2016-05-12
@frenkstar

Установить: npm i babel babel-preset-es2015 grunt grunt-babel load-grunt-tasks --save-dev
Добавить в файл .babelrc: { "presets": ["es2015"] }
В файле grunt:
require("load-grunt-tasks")(grunt);
grunt.initConfig({
dist: {
files: {
наши файлы компиляции
}
}
}
});
grunt.registerTask("default", ["babel"]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question