技術

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 を使っています。コメントデータの処理方法の詳細はこちらをご覧ください。

関連記事

docomo雑談対話APIを使って会話BOTを作りました。(LINE BOT + Heroku + Rails + docomo雑談API)

こんばんは 前回、LINE BOTを無料で試してみました。heroku + Ra …

no image

Angular6で子コンポーネントに文字列を渡す

文字列と変数の値を渡す時、記述が少しだけ違います。 // 文字列を渡したい時 & …

[ Rails ] ExecJS::RubyRacerRuntime is not supported. Please replace therubyracer with mini_racer in your Gemfile or use Node.js as ExecJS runtime.

こんにちは。たなかです。 モバイルアプリ開発の内容でブログを書くことが多い私です …

Siriに笑って欲しいから [iOS 11、macOS High Sierra](「Siri」の笑い声まとめ)

iPhone Xが発売されて巷はiPhone Xの記事ばかり。 なんとなく見てい …

Google PolyをFusion360でお試し

Googleさんが公開した無料の3Dデータライブラリ Poly AR・VRアプリ …