简体   繁体   中英

Multiple package.json Elastic Beanstalk deployment

In my project I have following directory structure:

  • Project/

    • Library1/

      package.json

    • Dependency2/

      package.json

    package.json

Locally I'm using grunt to install all dependencies, but Elastic BeanStalk only runs npm install for root package.json, so libraries dependencies will not be installed and project will fail.

I'm wondering how could I install Libary1/ and Library2/ dependencies at EC2 using some Amazon hooks (.ebextensions) or npm features without installing grunt and devdependencies there?

Thanks

You could use .ebextensions config for that.

For example add .ebextensions/npm_dependencies.config file to the Project folder:

commands:
    01_lib1_npm_install:
        command: npm install
        cwd: Library1/
    02_dep2_npm_install:
        command: npm install
        cwd: Dependency2/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM