code-server
code-server copied to clipboard
PM2 not working with binary (and a work around)
code-serverversion: Any release after 1.408-vsc1.32.0- OS Version: Ubuntu Server 18.04.2 LTS
Description
When trying to run the binary with pm2 you can't use command flags & the binary doesn't work (no output). Running the binary by itself works perfectly fine. Releases before 1.408-vsc1.32.0 work with pm2, any release after 1.408-vsc1.32.0 doesn't work with it. I've tested this with releases 1.32.0-310, 1.604-vsc1.32.0, and the latest release 1.939-vsc1.33.1.
Here's a work around you can use to get it working with pm2 You have to create a js file with the following contents:
const { execSync } = require('child_process');
execSync(`./code-server`,{stdio:['inherit','inherit','inherit']})
Replace ./code-server with your entire command and then run pm2 start ./yourFile.js
Steps to Reproduce
- Download any release after 1.408-vsc1.32.0
- Run the command
pm2 start ./code-serverorpm2 start ./code-server -- --anyArgument
If this still occurs, please feel free to reopen.