Run npm install --production on OpenShift

后端 未结 4 1493
一整个雨季
一整个雨季 2021-02-06 01:53

When I push my code to OpenShift, it looks like it\'s installing my devDependencies which takes forever. I would really love to set it up so it wil

4条回答
  •  -上瘾入骨i
    2021-02-06 02:30

    You can tell npm to install using the --production flag by setting the NPM_CONFIG_PRODUCTION environment variable to "true".

    Here is an example that should work for existing applications:

    rhc env set NPM_CONFIG_PRODUCTION="true"
    

    Or, you can set this variable as a part of your initial app-create step:

    rhc app create myapplication nodejs-0.10 NPM_CONFIG_PRODUCTION="true"
    

提交回复
热议问题