0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

spawn psが見つからないエラー

Posted at

エラー対応備忘録

環境

・フレームワーク;Nestjs

エラー内容

{ errno: -2, code: 'ENOENT', syscall: 'spawn ps', path: ps', spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 78 ] }

・エラーの意味
ホットリロード時にspawn psが実行されるが、コマンドが見つからない

コードの変更が検知された際にプロセス状態を確認して実行中であれば、そのプロセスを終了して新しいプロセスを起動する。そのプロセス状態を確認する際にpsコマンドを使用するが、見つからない。

nestjsのdockerコンテナはnode:18-slimを使用している
軽量版を使用しているためコマンドでツールを取得する必要があるのかもしれない

解決策

dockerFileに以下を追加
apt-get install -y procps

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?