ass="token string" style="color:rgb(255, 121, 198)">const pm2Config = require(&#x27;./ecosystem.config.js&#x27;);</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)">if (!pm2Config.apps || !Array.isArray(pm2Config.apps)) {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)">  throw new Error(&#x27;Invalid ecosystem.config.js: apps array not found&#x27;);</span><br><