简体   繁体   English

多个package.json Elastic Beanstalk部署

[英]Multiple package.json Elastic Beanstalk deployment

In my project I have following directory structure: 在我的项目中,我具有以下目录结构:

  • Project/ 项目/

    • Library1/ LIBRARY1 /

      package.json 的package.json

    • Dependency2/ Dependency2 /

      package.json 的package.json

    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. 在本地,我使用grunt安装所有依赖项,但是Elastic BeanStalk仅对根package.json运行npm install,因此将不会安装库依赖项,并且项目将失败。

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? 我想知道如何使用一些Amazon钩子(.ebextensions)或npm功能在EC2上安装Libary1 /和Library2 /依赖项,而无需在那里安装grunt和devdependencies?

Thanks 谢谢

You could use .ebextensions config for that. 您可以使用.ebextensions配置。

For example add .ebextensions/npm_dependencies.config file to the Project folder: 例如,将.ebextensions/npm_dependencies.config文件添加到Project文件夹:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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