2015-10-20 91 views
0

所以我想要部署此應用程序,這裏是我搜索互聯網的日誌,並沒有太多的幫助。以下是日誌Bluemix錯誤部署node.js應用程序buildpack

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 

的日誌,結果我該怎麼辦,請幫助!謝謝!

+0

你有一個package.json爲你的應用程序? –

回答

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嗎?

+0

當我嘗試運行_npm init_時,它說該命令無法識別。我試過_cf npm init_,但仍然無法工作。此外,這個命令做什麼。我也有一個package.json文件,它位於目錄中。 – Cornwellington

+0

好的,如果你有一個有效的package.json,你不需要運行npm命令。你可以驗證你的JSON文件是有效的嗎? http://jsonlint.com/ 是否可以將您的package.json文件發佈到此處以便我們檢查? –

0

我最近在解決這個問題。在我的情況下,原因是在bluemix deploy任務中,輸入是空的(這似乎是默認值,並且不提供任何警告)。儘管該項目已經正確設置,並且構建在手動完成之前就已經完成,但是在部署時卻並未實際推動任何事情。只需設置輸入以構建工件就可解決此問題,並按預期部署應用程序。

從命令行運行cf push成功,表示問題出在管道上,而不是項目。