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
This suggests the following approach:
"bower": "latest"
to package.json
Add script for postinstall:
"scripts": {
...
"postinstall": "HOME=$OPENSHIFT_REPO_DIR bower install || bower install"
},
well, for each time you need to use bower install
, you can use export HOME=$HOME/app-root/runtime/repo
in the RHC tool, and then into the folder './app-root/repo' you can use the bower install
, if bower
command is not available, go to folder './nodejs' and do npm install bower
.
Then, in order with RHC tool (this worked perfect to me):
rhc ssh proyect-name
cd nodejs
npm install bower
cd ..
export HOME=$HOME/app-root/runtime/repo
cd app-root/repo
bower install
done! good luck with your projects
Here is how I made use of bower
on OpenShift using the node.js cartridge:
Prerequisites:
bower install
from the root of the repo will do the job.Necessary steps:
.openshift/action_hooks/deploy
chmod +x .openshift/action_hooks/deploy
to make it executable BEFORE you add and commit it to your repo#!/usr/bin/env bash
HOME=$HOME/app-root/runtime
cd ~/repo
npm install bower
./node_modules/.bin/bower install