Deploy react app to AWS with pm2

0 votes

I am trying to deploy react app to AWS following this tutorial 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,550 points

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.

If you need to know more about React, Its recommended to join React course today.

Thank You!!

answered Feb 6, 2019 by Fatima

Related Questions In AWS

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
+1 vote
1 answer

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

refer this link You can't install the certificates ...READ MORE

answered Jul 19, 2018 in AWS by Priyaj
• 58,140 points