Unexpected token export when deploying a MERN app to digitalocean

Posted June 10, 2021 150 views
Node.jsGitDigitalOcean Droplets

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

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