The solutions offered in other related questions, such as including the proper presets (es2015) in .babelrc, are already implemented in my project.
I have two projec
I installed mocha and met the exact same error when I use import in my code. By doing the following actions, the issue was fixed.
npm install babel-core --save-dev
npm install babel-preset-es2015 --save-dev
npm install babel-preset-stage-0 --save-dev
And then add a .babelrc file:
{
"presets": [
"es2015"
]
}
And then run mocha in this way:
mocha --compilers js:babel-core/register