Unexpected token export when deploying a MERN app to digitalocean

Hi, I’m trying to deploy a MERN app to a digital ocean droplet. I have used nodemon and concurrently to run my app through “npm run dev”. Everything works fine when running in my local machine, but when I git clone the project to the droplet and try to npm run dev to run the app on the remote server, I get:

SyntaxError: Unexpected token export

I even removed the middleware where the error happens and tried to run again, but the error happened somewhere else in my code. I’ve stuck in this since yesterday. Do you have any idea?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer