簡體   English   中英

Heroku節點應用程序在驗證部署時意外掛起

[英]Heroku node app hung unexpectedly as verifying deploy

節點應用程序在本地一切正常,但是在執行git push時顯示永無休止地持續驗證部署?

它發生了三次,沒有成功或錯誤消息

Counting objects: 34, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (32/32), done.
Writing objects: 100% (34/34), 3.04 KiB | 0 bytes/s, done.
Total 34 (delta 24), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote: 
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_ENV=staging
remote:        NODE_MODULES_CACHE=true
remote:        
remote:        npm scripts will see NODE_ENV=production (not 'staging')
remote:        https://docs.npmjs.com/misc/config#production
remote: 
remote: -----> Installing binaries
remote:        engines.node (package.json):  >=0.10.0
remote:        engines.npm (package.json):   unspecified (use default)
remote:        
remote:        Resolving node version >=0.10.0 via semver.io...
remote:        Downloading and installing node 6.9.1...
remote:        Using default npm version: 3.10.8
remote: 
remote: -----> Restoring cache
remote:        Loading 2 from cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (not cached - skipping)
remote: 
remote: -----> Building dependencies
remote:        Installing node modules (package.json)
remote: Verifying deploy......................................................................................................................................

錯誤日志:

2017-01-23T12:33:34.342474+00:00 app[web.1]: 
2017-01-23T12:33:34.353035+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-01-23T12:33:34.343427+00:00 app[web.1]: npm ERR! missing script: start
2017-01-23T12:33:34.431311+00:00 heroku[web.1]: Process exited with status 1
2017-01-23T12:33:34.433894+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-23T13:42:29.700426+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=angular-frontend-stage.herokuapp.com request_id=44ab1149-b2db-436b-b646-f3781dd9df05 fwd="171.61.99.93" dyno= connect= service= status=503 bytes=
2017-01-23T13:42:31.276860+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=angular-frontend-stage.herokuapp.com request_id=070bb388-7a7b-409a-be6c-f7759c1c9ecc fwd="171.61.99.93" dyno= connect= service= status=503 bytes=
2017-01-23T13:43:24.665641+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-23T13:43:24.665662+00:00 heroku[slug-compiler]: Slug compilation timed out: 3600.422883083 seconds.

如您在錯誤日志中所見

2017-01-23T12:33:34.343427+00:00 app[web.1]: npm ERR! missing script: start

您的package.json文件沒有聲明任何start命令。

為了確定如何啟動您的應用,Heroku首先尋找一個Procfile。 如果Node.js應用程序不存在Procfile,我們將嘗試通過package.json中的啟動腳本啟動默認的Web進程。 Web進程類型中的命令必須綁定到PORT環境變量中指定的端口號。 如果沒有,則測功機將不會啟動。

您應該指定它,以使Heroku能夠啟動您的應用程序:

"scripts": {
  ...
  "start": "node server.js"
  ...
}

更新#1:

嘗試刪除Procfile ,然后在package.json

"scripts": {
  "start": "node server/app.js",
  "postinstall": "bower install && ./bin/www staging"
}

Heroku將運行npm install ,它將執行postinstall命令中存在的bower install

此外,您可以閱讀“ Heroku:自定義構建過程”

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM