错误的ERR! EEXIST - 无法将SailsJS应用程序部署到Openshift

时间:2016-06-01 22:34:40

标签: node.js git sails.js openshift

我是 Openshift SailsJS

的新手

非常欢迎任何前进的指针。

我创建了一个简单的Sails应用程序,例如sails new myapp,并遵循Openshift部署指令here

的package.json

package.json我已经尝试了node app.jssails lift来启动我的应用。

  "scripts": {
    "debug": "node debug app.js",
    "start": "node app.js"
  },
  "dependencies": {
    "ejs": "2.3.4",
    "grunt": "0.4.5",
    "grunt-bower": "^0.21.2",
    "grunt-bower-task": "^0.3.4",
    "grunt-cli": "^1.2.0",
    "grunt-contrib-clean": "0.6.0",
    "grunt-contrib-coffee": "0.13.0",
    "grunt-contrib-concat": "0.5.1",
    "grunt-contrib-copy": "0.5.0",
    "grunt-contrib-cssmin": "0.9.0",
    "grunt-contrib-jst": "0.6.0",
    "grunt-contrib-less": "1.1.0",
    "grunt-contrib-uglify": "0.7.0",
    "grunt-contrib-watch": "0.5.3",
    "grunt-sails-linker": "~0.10.1",
    "grunt-sync": "0.2.4",
    "include-all": "~0.1.6",
    "rc": "1.0.1",
    "sails": "~0.12.3",
    "sails-disk": "~0.10.9"
  },
  "name": "myapp",
  "private": true,
  "version": "0.0.0",
  "description": "a Sails application",
  "keywords": [],
  "main": "app.js",
  "repository": {
    "type": "git",
    "url": "git://github.com/joel/myapp.git"
  },
  "author": "joel",
  "license": ""
}

git push openshift

remote: npm ERR! EEXIST, open '/var/lib/openshift/574f48527628e1bce8000273/.npm/68d71095-273-npm-lodash-2-4-2-package-tgz.lock'
remote: File exists: /var/lib/openshift/574f48527628e1bce8000273/.npm/68d71095-273-npm-lodash-2-4-2-package-tgz.lock
remote: Move it away, and try again. 
remote: 
remote: npm ERR! System Linux 2.6.32-573.12.1.el6.x86_64
remote: npm ERR! command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "-d"
remote: npm ERR! cwd /var/lib/openshift/574f48527628e1bce8000273/app-root/runtime/repo
remote: npm ERR! node -v v0.10.35
remote: npm ERR! npm -v 1.4.28
remote: npm ERR! path /var/lib/openshift/574f48527628e1bce8000273/.npm/68d71095-273-npm-lodash-2-4-2-package-tgz.lock
remote: npm ERR! code EEXIST
remote: npm ERR! errno 47
remote: npm info preuninstall reportback@0.1.9
remote: npm info uninstall reportback@0.1.9
remote: npm info postuninstall reportback@0.1.9
remote: npm info preuninstall merge-defaults@0.2.1
remote: npm info uninstall merge-defaults@0.2.1
remote: npm info postuninstall merge-defaults@0.2.1
remote: npm info preuninstall sails-stringfile@0.3.2
remote: npm info uninstall sails-stringfile@0.3.2
remote: npm info postuninstall sails-stringfile@0.3.2
remote: npm info preuninstall sails-generate@0.13.0
remote: npm info uninstall sails-generate@0.13.0
remote: npm info postuninstall sails-generate@0.13.0
remote: npm info preuninstall sails@0.12.3
remote: npm info uninstall sails@0.12.3
remote: npm info postuninstall sails@0.12.3
remote: npm ERR! not ok code 0
remote: An error occurred executing 'gear postreceive' (exit code: 47)
remote: Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/574f48527628e1bce8000273/nodejs
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://574f48527628e1bce8000273@myapp.rhcloud.com/~/git/myapp.git
   cdc73e6..df77e95  HEAD -> master

我应该尝试使用--trace运行什么命令?

rhc tail -a myapp

DEBUG: Starting child process with 'node app.js'
DEBUG: Sending SIGTERM to child...
DEBUG: Running node-supervisor with
DEBUG:   program 'app.js'
DEBUG:   --watch '/var/lib/openshift/574f48527628e1bce8000273/app-root/data/.nodewatch'
DEBUG:   --ignore 'undefined'
DEBUG:   --extensions 'node|js|coffee'
DEBUG:   --exec 'node'
DEBUG: Starting child process with 'node app.js'
DEBUG: Watching directory '/var/lib/openshift/574f48527628e1bce8000273/app-root/data/.nodewatch' for changes.
To run an app using `node app.js`, you usually need to have a version of `sails` installed in the same directory as your app.
To do that, run `npm install sails`
Alternatively, if you have sails installed globally (i.e. you did `npm install -g sails`), you can use `sails lift`.
When you run `sails lift`, your app will still use a local `./node_modules/sails` dependency if it exists,
but if it doesn't, the app will run with the global sails instead!
DEBUG: Program node app.js exited with code 0
DEBUG: Starting child process with 'node app.js'
To run an app using `node app.js`, you usually need to have a version of `sails` installed in the same directory as your app.
To do that, run `npm install sails`
Alternatively, if you have sails installed globally (i.e. you did `npm install -g sails`), you can use `sails lift`.
When you run `sails lift`, your app will still use a local `./node_modules/sails` dependency if it exists,
but if it doesn't, the app will run with the global sails instead!
DEBUG: Program node app.js exited with code 0

1 个答案:

答案 0 :(得分:0)

阻挡者似乎是:

remote: File exists: /var/lib/openshift/574f48527628e1bce8000273/.npm/68d71095-273-npm-lodash-2-4-2-package-tgz.lock

这些步骤有助于我前进

rhc ssh -a myapp 
cd .npm
rm 68d71095-273-npm* 

然后从本地计算机再次部署

git push