Answer the question
In order to leave comments, you need to log in
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
try compiling ES6 to ES5 using grunt+babel.
Maybe this article will help
Babel + Grunt === ES6 Now!
Обновите ноду до версии 4.х (стабильное ядро v8) или 5.х (самое свежее ядро v8)
Установить: 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 questionAsk a Question
731 491 924 answers to any question