无法在Openshift上安装凉亭

我无法在Openshift上安装凉亭。 我不断收到错误

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这里]。

我尝试了几种方法:1)有和没有.bowerrc文件

情况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 install bower

  npm cache clear npm cache clean 

任何帮助解决这个问题都会很好。

如果你想看看我的回购你可以在这里find它: https : //github.com/prasunsultania/demoblog

以下是我如何使用node.js磁带在OpenShift上使用bower

先决条件:

  • 通常你已经在全球安装了Bower。
  • 你推送到OpenShift的git仓库必须很容易地configuration为使用Bower,这样从bower install的根目录bower install才能完成这个工作。

必要步骤:

  1. 创build文件.openshift/action_hooks/deploy
  2. 执行chmod +x .openshift/action_hooks/deploy以使其可执行之前,您添加并提交到您的回购
  3. 将以下行添加到文件中:

#!/usr/bin/env bash

 HOME=$HOME/app-root/runtime cd ~/repo npm install bower ./node_modules/.bin/bower install 
  1. 添加并提交文件到你的git仓库
  2. 推你的Git仓库到OpenShift

这提示了以下方法:

  1. 将依赖关系"bower": "latest"package.json
  2. 为postinstall添加脚本:

     "scripts": { ... "postinstall": "HOME=$OPENSHIFT_REPO_DIR bower install || bower install" }, 

好的,每次你需要使用bower install ,你可以在RHC工具中使用export HOME=$HOME/app-root/runtime/repo ,然后进入你可以使用的./app-root/repo文件夹bower install ,如果bower命令不可用,则转到文件夹“./nodejs”并执行npm install bower

然后,为了与RHC工具(这对我来说很完美):

  • 1 – rhc ssh proyect-name
  • 2 – cd nodejs
  • 3 – npm install bower
  • 4 – cd ..
  • 5 – export HOME=$HOME/app-root/runtime/repo
  • 6 – cd app-root/repo
  • 7 – bower install

完成了! 祝你的项目好运