Deploy react app to AWS with pm2

0 votes

I am trying to deploy react app to AWS following this tutorial https://medium.com/@sgobinda007/setting-up-react-redux-application-for-production-and-hosting-in-aws-ec2-8bbb8bf3c643 my app is slightly different and when I run pm2 start ecosystem.config.js --env production I get that app status is online but on pm2 show status is errored with the following output: /home/ubuntu/www/react/tools/distServer.js:4

import browserSync from 'browser-sync';
^^^^^^
|| SyntaxError: Unexpected token import
my ecosystem.config.js file looks like this:

module.exports = {
   apps : [
      {
         name: "blockchainwallet",
         script: "tools/distServer.js",
         watch: true,
         env: {
            "PORT": 8080,
            "NODE_ENV": "development"
         },
         env_production: {
            "PORT": 3000,
            "NODE_ENV": "production",
         }
      }
   ]
}

could you give me any suggestions in order to fix this bug?

Aug 20, 2018 in AWS by bug_seeker
• 15,400 points
1,286 views

1 answer to this question.

0 votes
Under 'tools' directory, in 'distServer.js' try to change all your imports from syntax to required syntax (including the destructing of chalkConfig). This will work.
answered Feb 6, 2019 by Fatima

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
599 views
0 votes
1 answer
0 votes
1 answer

How to add SSL certificate to AWS EC2 with the help of new AWS Certificate Manager service

refer this link  https://aws.amazon.com/certificate-manager/faqs/ You can't install the certificates ...READ MORE

answered Jul 19, 2018 in AWS by Priyaj
• 57,550 points
227 views