My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

SyntaxError: Unexpected token import

Anuj Sharma's photo
Anuj Sharma
·Mar 20, 2017

Hello,

I am getting this error

When I was run it via simple command "pm2 start test.js"

import express from 'express';
^^^^^^
SyntaxError: Unexpected token import

But if I run it via grunt. Its working fine.

I want to run it via PM2.

I search over google and try to find out reason but I am not satisfied.

Lots of thanks in Advance.