<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>thr3a</author_name>
  <author_url>https://blog.hatena.ne.jp/thr3a/</author_url>
  <blog_title>動かざることバグの如し</blog_title>
  <blog_url>https://blog.turai.work/</blog_url>
  <categories>
    <anon>nodejs</anon>
  </categories>
  <description>環境 Node.js v24 PM2 やりたいこと TypeScript製のWebサーバーを以下のコマンドで起動している。 node --import tsx ./src/web/server.ts --port 3000 今はこれを nohup で動かしているのだが、いくつか不満がある。 サーバー再起動後に自動起動しない（手動で立ち上げ直す必要がある） プロセスが落ちても自動で再起動しない ログ管理が貧弱でローテーションも自分でやる必要がある これを PM2 で管理することで、プロセスの永続化・自動起動・ログ管理をまとめて解決したい。 解決策 PM2 の設定は ecosystem.confi…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.turai.work%2Fentry%2F20260607%2F1780839875&quot; title=&quot;Node.js TypeScriptサーバーをPM2で永続化する - 動かざることバグの如し&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-06-07 22:44:35</published>
  <title>Node.js TypeScriptサーバーをPM2で永続化する</title>
  <type>rich</type>
  <url>https://blog.turai.work/entry/20260607/1780839875</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
