无法将node.js cloudant app推送到bluemix

时间:2016-06-10 17:43:51

标签: node.js ibm-cloud cloudant

我尝试将cloudant添加到我的应用中,突然之间我再也无法将其推送到bluemix了。我将其追踪到1行导致了问题:

var cloudant = require('cloudant');

在此之前它上传没有任何问题。在推动过程中,一切都很好,直到它试图重新启动液滴

结束
-----> Uploading droplet (20M)
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful

我看到一篇关于使用后来的节点引擎"node": "0.12.x"的帖子但是没有用。我删除了node_module目录并执行了npm安装,以确认我可以在本地运行此应用程序并且package.json是好的。

$ cat manifest.yml
applications:
- path: .
  memory: 256M
  instances: 1
  domain: stage1.mybluemix.net
  name: myapp
  host: myapp
  disk_quota: 1024M
  command: node server.js
  services:
  - myNoSQLDB

$ cat package.json
{
  "name": "myapp",
  "version": "1.0.0",
  "description": "my test app",
  "private": true,
  "scripts": {
  "start": "node server.js"
  },
  "dependencies": {
    "angular": "1.4.x",
    "angular-route": "1.4.x",
    "body-parser": "^1.15.1",
    "bootstrap": "3.3.x",
    "cfenv": "1.0.x",
    "cloudant": "1.4.x",
    "depd": "^1.1.0",
    "console-stamp": "^0.2.2",
    "cookie-parser": "1.4.x",
    "express": "4.13.x",
    "express-session": "1.11.x",
    "fs": "0.0.x",
    "https": "1.0.x",
    "jquery": "2.2.x",
    "passport": "0.2.x"
  },
  "repository": {},
  "engines": {
    "node": "4.x"
  }
}

当第一次发生时,我看了cf logs my app --recent的输出并显示了

  

错误:无法找到模块'depd'

应该作为依赖项安装。所以我把它添加到我的package.json中。现在它出现了一个不同的缺失模块!

以下是cf logs myapp --recent:

的输出
2016-06-10T13:01:07.81-0400 [DEA/20]     OUT Starting app instance (index 0) with guid 28bae25d-5202-46d9-8d53-394711f2db0d
2016-06-10T13:01:18.53-0400 [App/0]      ERR module.js:327
2016-06-10T13:01:18.53-0400 [App/0]      ERR     throw err;
2016-06-10T13:01:18.53-0400 [App/0]      ERR     ^
2016-06-10T13:01:18.53-0400 [App/0]      ERR Error: Cannot find module 'content-type'
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Function.Module._resolveFilename (module.js:325:15)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Function.Module._load (module.js:276:25)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Module.require (module.js:353:17)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at require (internal/module.js:12:17)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Object.<anonymous> (/home/vcap/app/node_modules/body-parser/lib/types/urlencoded.js:16:19)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Module._compile (module.js:409:26)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Object.Module._extensions..js (module.js:416:10)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Module.load (module.js:343:32)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Function.Module._load (module.js:300:12)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at Module.require (module.js:353:17)
2016-06-10T13:01:18.53-0400 [App/0]      ERR     at require (internal/module.js:12:17)
2016-06-10T13:01:18.53-0400 [App/0]      OUT
2016-06-10T13:01:18.62-0400 [DEA/20]     ERR Instance (index 0) failed to start accepting connections
2016-06-10T13:01:18.66-0400 [API/1]      OUT App instance exited with guid 28bae25d-5202-46d9-8d53-394711f2db0d payload: {"cc_partition"=>"default", "droplet"=>"28bae25d-5202-46d9-8d53-394711f2db0d", "version"=>"7a0c73de-69cc-48d6-9d70-2397d56a6174", "instance"=>"62e1200500034fa5a7e41ffa0ae2715d", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1465578078}
2016-06-10T13:01:18.66-0400 [API/1]      OUT App instance exited with guid 28bae25d-5202-46d9-8d53-394711f2db0d payload: {"cc_partition"=>"default", "droplet"=>"28bae25d-5202-46d9-8d53-394711f2db0d", "version"=>"7a0c73de-69cc-48d6-9d70-2397d56a6174", "instance"=>"62e1200500034fa5a7e41ffa0ae2715d", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1465578078}

我看到一篇关于此的帖子,修复是删除node_module目录并重新安装,但这应该是推送到bluemix时的默认设置,所有模块都会重新安装。

这是针对bluemix和cloudant的特定内容吗?我之前将应用程序推送到bluemix没有问题,我错过了什么?

这两个模块似乎都来自明确的依赖。为什么bluemix没有安装它?

我有一个.cfignore文件,但列出了node_module下的所有子目录,因为bluemix表示必须从他们的站点下载模块passport-idaas-openidconnect,因为该模块的npm存在问题。

0 个答案:

没有答案