Bluemix错误部署node.js应用程序buildpack

时间:2015-10-20 14:26:47

标签: node.js ibm-cloud buildpack package.json

所以我试图部署这个应用程序,这里是我在互联网上搜索的日志,对此没什么帮助。这是日志

2015-10-20T10:15:53.17-0400 [API/0]      OUT Updated app with guid 1928479c-5e79-47bc-a8e0-1bc7d7fb34b1 ({"name"=>"braincar", "buildpack"=>"https://github.com/cloudfoundry/nodejs-buildpack"})
2015-10-20T10:17:46.30-0400 [API/0]      OUT Updated app with guid 1928479c-5e79-47bc-a8e0-1bc7d7fb34b1 ({"state"=>"STOPPED"})
2015-10-20T10:17:5 [DEA/101]             OUT Got staging request for app with id 1928479c-5e79-47bc-a8e0-1bc7g43q
2015-10-20T10:17:59.47-0400 [API/2]      OUT Updated app with guid 1928479c-5e79-47bc-a8e0-1bc7d7fb34b1 ({"state"=>"STARTED"})
2015-10-20T10:17:59.61-0400 [STG/101]    OUT -----> Downloaded app package (32K)
2015-10-20T10:17:59.72-0400 [STG/0]      ERR Cloning into '/tmp/buildpacks/nodejs-buildpack'...
2015-10-20T10:18:01.23-0400 [STG/0]      OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
2015-10-20T10:18:01.28-0400 [STG/0]      ERR Cloning into 'compile-extensions'...
2015-10-20T10:18:02.39-0400 [STG/0]      OUT Submodule path 'compile-extensions': checked out 'ce9345a9a6e7b00266194cadd18fdwqfe4q'
2015-10-20T10:18:02.48-0400 [STG/0]      OUT -------> Buildpack version 1.5.0
2015-10-20T10:18:02.50-0400 [STG/0]      ERR cat: /tmp/staged/app/package.json: No such file or directory
2015-10-20T10:18:02.51-0400 [STG/0]      ERR  !     Unable to parse package.json
2015-10-20T10:18:02.51-0400 [STG/0]      OUT -----> Build failed
2015-10-20T10:18:02.51-0400 [STG/0]      OUT        We're sorry this build is failing! You can troubleshoot common issues here:
2015-10-20T10:18:02.51-0400 [STG/0]      OUT        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
2015-10-20T10:18:02.52-0400 [STG/0]      OUT        If you're stuck, please submit a ticket so we can help:
2015-10-20T10:18:02.52-0400 [STG/0]      OUT        https://help.heroku.com/
2015-10-20T10:18:02.52-0400 [STG/0]      OUT        Love,
2015-10-20T10:18:02.52-0400 [STG/0]      OUT        Heroku
2015-10-20T10:18:02.52-0400 [STG/0]      OUT Staging failed: Buildpack compilation step failed
2015-10-20T10:18:02.86-0400 [API/2]      ERR encountered error: App staging failed in the buildpack compile phase

所以现在我应该怎么做才能加载这个我尝试运行这个命令......

 cf push braincar -b https://github.com/cloudfoundry/nodejs-buildpack

上面的日志是结果我该怎么办请帮忙!谢谢!

2 个答案:

答案 0 :(得分:1)

从日志中,应用程序缺少 package.json 文件。

ERR cat: /tmp/staged/app/package.json: No such file or directory
2015-10-20T10:18:02.51-0400 [STG/0]      ERR  !     Unable to parse package.json

这是配置和运行应用程序所必需的。你能确保在项目目录中运行 npm init 吗?

答案 1 :(得分:0)

我最近解决了这个问题。在我的情况下,原因是在bluemix部署任务中输入为空(这似乎是默认值,并没有给出任何警告)。虽然项目已经正确设置并且构建在运行之前已经成功运行,但在部署时,它实际上并没有尝试推送任何东西。简单地设置输入以构建人工制品解决了这个问题,并按预期部署了应用程序。

从命令行运行cf push成功,这表明问题出在管道上,而不是项目。

相关问题