技術

heroku + node.jsでError R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

投稿日:

こんにちは

heroku + node.jsでアプリを作っていて、いざherokuにpushしたらerrorがでました。

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
Process exited with status 137
State changed from starting to crashed

node serverを立てていなくてerrorがでてたので
expressでnode serverを作成。

もう一度push

またerror。。

port番号をローカル用に5000を設定していたのですが、herokuで決められたport番号を設定しないとerrorがでるようです。
なので下記に修正

const PORT = process.env.PORT || 5000;

これで正常に動くようになりました!

-技術

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

関連記事

[ Ionic ] A problem occurred evaluating project ‘:app’. > Failed to apply plugin [class ‘com.google.gms.googleservices.GoogleServicesPlugin’] > For input string: “+”

こんにちは。たなかです。 相変わらずモバイルアプリ開発やっています。 先日、Io …

[AWS S3] This XML file does not appear to have any style information associated with it. The document tree is shown below.

はじめまして。田中です。 AWSを触りはじめてから1ヶ月ちょっと。七転び八起きな …

[Angular6] 一つのタグに複数の条件分岐を書く

こんにちは どうしても一つのタグに複数の条件分岐を書きたい時があるかと思います。 …

no image

【nginx】そうだ!Basic認証を掛けよう

どうも、中田です。 nginxでベーシック認証をかける方法です。 これからもよく …

どうも中田です。 Let’s Encryptって無料だし便利ですよね …