问题描述
我无法在Openshift上安装Bower.我不断收到类似的错误
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/repo/node_modules/bower/node_modules/mout/array/intersection.js'[K
remote: npm ERR! If you need help, you may report this log at:[K
remote: npm ERR! <http://github.com/isaacs/npm/issues>[K
remote: npm ERR! or email it to:[K
remote: npm ERR! <npm-@googlegroups.com>[K
您可以看到完整的部署日志 https://s3.amazonaws.com/archive.travis-ci.org/jobs/26291843/log.txt [从travis这里].
You can see full deployment logs https://s3.amazonaws.com/archive.travis-ci.org/jobs/26291843/log.txt [From travis here].
我尝试了几种方法:1)有和没有.bowerrc文件
I tried several approaches:1) with and without .bowerrc file
情况:1
{
"directory": "~/app-root/runtime/repo/public/libs"
"storage": {
"cache": "~/app-root/runtime/repo/node_modules/bower/cache",
"completion": "~/app-root/runtime/repo/node_modules/bower/completion",
"git": "~/app-root/runtime/repo/node_modules/bower/git_template"
},
"interactive": "false",
"tmp":"~/app-root/runtime/repo/node_modules/bower/tmp",
"cwd":"~/app-root/runtime/repo"
}
情况:2
{
"directory": "public libs"
}
还尝试在[$ HOME/app-root/runtime/repo]中运行以下命令,并尝试通过SSH shell安装npm bower
Also, tried running following commands [In $HOME/app-root/runtime/repo] and tried npm install bower by SSH shell
npm cache clear
npm cache clean
任何帮助解决此问题的方法都会很棒.
Any help to resolve this would be great.
如果您想查看我的仓库,可以在这里找到它: https://github.com/prasunsultania /demoblog
In case you want to look at my repo you can find it here: https://github.com/prasunsultania/demoblog
推荐答案
这是我使用node.js墨盒在OpenShift上使用bower
的方法:
Here is how I made use of bower
on OpenShift using the node.js cartridge:
先决条件:
- 通常,您已在全球范围内安装了Bower.
- 推送到OpenShift的git repo必须易于配置为使用Bower,以便来自repo根的
bower install
可以完成工作.
- 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.
必要步骤:
- 创建文件
.openshift/action_hooks/deploy
- 在添加并将其提交到存储库之前,先执行
chmod +x .openshift/action_hooks/deploy
使其可执行. - 将以下行添加到文件中:
- Create the file
.openshift/action_hooks/deploy
- Do
chmod +x .openshift/action_hooks/deploy
to make it executable BEFORE you add and commit it to your repo - 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
- 添加文件并将其提交到您的git repo
- 将您的git存储库推送到OpenShift
这篇关于无法在Openshift上安装凉亭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!