Unable to install bower on Openshift

前端 未结 3 1605
长情又很酷
长情又很酷 2021-02-09 05:25

I am unable to install bower on Openshift. I keep on getting errors like

remote: npm ERR! Error: ENOENT, lstat \'/var/lib/openshift/537xxxxcd/app-root/runtime/re         


        
3条回答
  •  醉酒成梦
    2021-02-09 06:18

    Here is how I made use of bower on OpenShift using the node.js cartridge:

    Prerequisites:

    • Usually you have installed Bower globally.
    • The git repo which you push to OpenShift must be readily configured for using Bower so that bower install from the root of the repo will do the job.

    Necessary steps:

    1. Create the file .openshift/action_hooks/deploy
    2. Do chmod +x .openshift/action_hooks/deploy to make it executable BEFORE you add and commit it to your repo
    3. Add the following lines to the file:

    #!/usr/bin/env bash

    HOME=$HOME/app-root/runtime
    cd ~/repo
    npm install bower
    ./node_modules/.bin/bower install
    
    1. Add and commit the file to your git repo
    2. Push your git repo to OpenShift

提交回复
热议问题