npm script execution fails in ide but works in terminal for es6

Answered

I have copied a very simple hello world app to demonstrate this issue.

When executing a script from the ide, it fails on the import statement showing the following error...

import express from 'express';
^^^^^^^

SyntaxError: Unexpected identifier

When executing the script from terminal, it works fine.

If I use an npm script that compiles with babel, it works in both the ide and the terminal.

Why is this the case?

 

 

 

0

Please sign in to leave a comment.