In js file, i used import to instead of require
import co from \'co\';
And tried to run it directly by nodejs since it said import is \'shi
babel-core, babel-polyfill, babel-preset-es2015.babelrc with contents: { "presets": ["es2015"] }import statement in your main entry file, use another file eg: app.js and your main entry file should required babel-core/register and babel-polyfill to make babel works separately at the first place before anything else. Then you can require app.js where import statement.Example:
index.js
require('babel-core/register');
require('babel-polyfill');
require('./app');
app.js
import co from 'co';
It should works with node index.js.