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?
Please sign in to leave a comment.
Please see https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import.