npm install
を実行したところ以下のエラーが発生。(ファイルパスなどは一部省略)
npm ERR! code EAGAIN
npm ERR! syscall spawn sh
npm ERR! path ...
npm ERR! errno -35
npm ERR! spawn sh EAGAIN
npm ERR! command sh -c node ...
npm ERR! A complete log of this run can be found in:
npm ERR! ....
よく分からなかったので色々ググっていたら、以下の記事を発見。
https://itpfdoc.hitachi.co.jp/manuals/3020/30203K2843/AJSM0023.HTM
EAGAIN
というのが、プロセスの過多や一時的なメモリ不足が原因で発生するシステムコールエラーのようです。
そこでプロセスの過多や一時的なメモリ不足の解消方法をググりました。
https://www.4900.co.jp/smarticle/6986/
こちらを参考に起動中のアプリをいくつか終了させたあと、再度npm install
コマンドを実行したところ、エラー解消できました!