babel-preset-es2015
is installed, and is OK with es6 feature just like below let a = 2;
.
But can not work with es6 modules feature import
The error message is exactly what it says. You cannot use ES6 module syntax in the REPL, it is unsupported. You can create a small adapter that imports as ES6 and exports as CommonJS:
# es6-to-common.js
import MyThing from './somewhere';
module.exports = MyThing;
Now inside your usual babel-node
prompt:
> MyThing = require('./es6-to-common')