Deploying a Node app in a subdirectory on AWS Elastic Beanstalk









up vote
0
down vote

favorite












I am currently in the process of setting up my first Elastic Beanstalk Node application and I have hit a snag.



I followed this tutorial to get a working Express application running with no view-engine (going to be using React):



https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html



However, I want to move it to the /app directory so that eventually I can install a Wordpress instance in the root directory to use as a quick public facing intro to our application with a blog.



The project looks like this:



my-app

// Wordpress Files Here

/.ebextensions
/app
/bin
/client

// React Files Here

/node_modules
/public
/routes
/app.js
/package-lock.json
/package.json


With all of the Node files in the root directory, everything works as expected. When I move everything to the app directory and add this to the .ebextensions/01_nodeconfig.config file:



commands:
01_npm_install:
command: npm install
cwd: app/


I get this error on eb deploy:




2018-11-09 17:39:35 INFO Environment update is starting.



2018-11-09 17:40:15 INFO Deploying new version to instance(s).



2018-11-09 17:40:22 ERROR [Instance: i-0eedebf7a339e69ca] Command failed on instance. Return code: 1 Output: [Errno 2] No such file or directory: 'app/'.
EBExtension failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.



2018-11-09 17:40:23 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].



2018-11-09 17:40:23 ERROR Unsuccessful command execution on instance id(s) 'i-0eedebf7a339e69ca'. Aborting the operation.



2018-11-09 17:40:23 ERROR Failed to deploy application.




When I look in the log, here is what is returned:




[2018-11-09T17:40:20.819Z] INFO [26711] - [Application update app-4f25-181109_123930@15/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory: 'app/' (ElasticBeanstalk::ExternalInvocationError)




Does anyone have an idea on why it cannot find the app directory even though it is right there?



Thanks.










share|improve this question

























    up vote
    0
    down vote

    favorite












    I am currently in the process of setting up my first Elastic Beanstalk Node application and I have hit a snag.



    I followed this tutorial to get a working Express application running with no view-engine (going to be using React):



    https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html



    However, I want to move it to the /app directory so that eventually I can install a Wordpress instance in the root directory to use as a quick public facing intro to our application with a blog.



    The project looks like this:



    my-app

    // Wordpress Files Here

    /.ebextensions
    /app
    /bin
    /client

    // React Files Here

    /node_modules
    /public
    /routes
    /app.js
    /package-lock.json
    /package.json


    With all of the Node files in the root directory, everything works as expected. When I move everything to the app directory and add this to the .ebextensions/01_nodeconfig.config file:



    commands:
    01_npm_install:
    command: npm install
    cwd: app/


    I get this error on eb deploy:




    2018-11-09 17:39:35 INFO Environment update is starting.



    2018-11-09 17:40:15 INFO Deploying new version to instance(s).



    2018-11-09 17:40:22 ERROR [Instance: i-0eedebf7a339e69ca] Command failed on instance. Return code: 1 Output: [Errno 2] No such file or directory: 'app/'.
    EBExtension failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.



    2018-11-09 17:40:23 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].



    2018-11-09 17:40:23 ERROR Unsuccessful command execution on instance id(s) 'i-0eedebf7a339e69ca'. Aborting the operation.



    2018-11-09 17:40:23 ERROR Failed to deploy application.




    When I look in the log, here is what is returned:




    [2018-11-09T17:40:20.819Z] INFO [26711] - [Application update app-4f25-181109_123930@15/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory: 'app/' (ElasticBeanstalk::ExternalInvocationError)




    Does anyone have an idea on why it cannot find the app directory even though it is right there?



    Thanks.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am currently in the process of setting up my first Elastic Beanstalk Node application and I have hit a snag.



      I followed this tutorial to get a working Express application running with no view-engine (going to be using React):



      https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html



      However, I want to move it to the /app directory so that eventually I can install a Wordpress instance in the root directory to use as a quick public facing intro to our application with a blog.



      The project looks like this:



      my-app

      // Wordpress Files Here

      /.ebextensions
      /app
      /bin
      /client

      // React Files Here

      /node_modules
      /public
      /routes
      /app.js
      /package-lock.json
      /package.json


      With all of the Node files in the root directory, everything works as expected. When I move everything to the app directory and add this to the .ebextensions/01_nodeconfig.config file:



      commands:
      01_npm_install:
      command: npm install
      cwd: app/


      I get this error on eb deploy:




      2018-11-09 17:39:35 INFO Environment update is starting.



      2018-11-09 17:40:15 INFO Deploying new version to instance(s).



      2018-11-09 17:40:22 ERROR [Instance: i-0eedebf7a339e69ca] Command failed on instance. Return code: 1 Output: [Errno 2] No such file or directory: 'app/'.
      EBExtension failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.



      2018-11-09 17:40:23 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].



      2018-11-09 17:40:23 ERROR Unsuccessful command execution on instance id(s) 'i-0eedebf7a339e69ca'. Aborting the operation.



      2018-11-09 17:40:23 ERROR Failed to deploy application.




      When I look in the log, here is what is returned:




      [2018-11-09T17:40:20.819Z] INFO [26711] - [Application update app-4f25-181109_123930@15/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory: 'app/' (ElasticBeanstalk::ExternalInvocationError)




      Does anyone have an idea on why it cannot find the app directory even though it is right there?



      Thanks.










      share|improve this question













      I am currently in the process of setting up my first Elastic Beanstalk Node application and I have hit a snag.



      I followed this tutorial to get a working Express application running with no view-engine (going to be using React):



      https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html



      However, I want to move it to the /app directory so that eventually I can install a Wordpress instance in the root directory to use as a quick public facing intro to our application with a blog.



      The project looks like this:



      my-app

      // Wordpress Files Here

      /.ebextensions
      /app
      /bin
      /client

      // React Files Here

      /node_modules
      /public
      /routes
      /app.js
      /package-lock.json
      /package.json


      With all of the Node files in the root directory, everything works as expected. When I move everything to the app directory and add this to the .ebextensions/01_nodeconfig.config file:



      commands:
      01_npm_install:
      command: npm install
      cwd: app/


      I get this error on eb deploy:




      2018-11-09 17:39:35 INFO Environment update is starting.



      2018-11-09 17:40:15 INFO Deploying new version to instance(s).



      2018-11-09 17:40:22 ERROR [Instance: i-0eedebf7a339e69ca] Command failed on instance. Return code: 1 Output: [Errno 2] No such file or directory: 'app/'.
      EBExtension failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.



      2018-11-09 17:40:23 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].



      2018-11-09 17:40:23 ERROR Unsuccessful command execution on instance id(s) 'i-0eedebf7a339e69ca'. Aborting the operation.



      2018-11-09 17:40:23 ERROR Failed to deploy application.




      When I look in the log, here is what is returned:




      [2018-11-09T17:40:20.819Z] INFO [26711] - [Application update app-4f25-181109_123930@15/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory: 'app/' (ElasticBeanstalk::ExternalInvocationError)




      Does anyone have an idea on why it cannot find the app directory even though it is right there?



      Thanks.







      node.js amazon-ec2 amazon-elastic-beanstalk






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 9 at 18:01









      Nick B.

      115




      115



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231098%2fdeploying-a-node-app-in-a-subdirectory-on-aws-elastic-beanstalk%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231098%2fdeploying-a-node-app-in-a-subdirectory-on-aws-elastic-beanstalk%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo