After installing pm2 globally using npm, I am trying to install the completion cli using pm2 completion install
After PM2 is daemonized, it throws the following error
[PM2] Spawning PM2 daemon with pm2_home=C:\Users\jesse\.pm2
[PM2] PM2 Successfully daemonized
C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:191
var file = '.' + process.env.SHELL.match(/\/bin\/(\w+)/)[1] + 'rc',
^
TypeError: Cannot read property 'match' of undefined
at readRc (C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:191:38)
at install (C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:143:3)
at Object.complete (C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:27:26)
at checkCompletion (C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\bin\pm2:153:17)
at C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\bin\pm2:216:7
at C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\API.js:186:16
at C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\API\Modules\Modularizer.js:78:19
at C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\node_modules\async\internal\once.js:12:16
at replenish (C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\node_modules\async\internal\eachOfLimit.js:61:25)
at C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\node_modules\async\internal\eachOfLimit.js:71:9
Install pm2 globally on windows 10 where node/npm are installed in %appdata%
run pm2 completion install
--- PM2 report ----------------------------------------------------------------
Date : Thu Jan 31 2019 12:27:48 GMT-0500 (Eastern Standard Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 3.2.9
node version : 11.7.0
node path : not found
argv : C:\Program Files\nodejs\node.exe,C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0 : node
user : undefined
uid : N/A
gid : N/A
uptime : 0min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 3.2.9
node version : 11.7.0
node path : not found
argv : C:\Program Files\nodejs\node.exe,C:\Users\jesse\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0 : node
user : jesse
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : win32
type : Windows_NT
cpus : AMD A8-7410 APU with AMD Radeon R5 Graphics
cpus nb : 4
freemem : 8339337216
totalmem : 11744317440
home : C:\Users\jesse
===============================================================================
--- PM2 list -----------------------------------------------
โโโโโโโโโโโโฌโโโโโฌโโโโโโโโโโฌโโโโโโโฌโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ version โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโดโโโโโดโโโโโโโโโโดโโโโโโโดโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโดโโโโโโโดโโโโโโโโโโโ
===============================================================================
--- Daemon logs --------------------------------------------
C:\Users\jesse\.pm2\pm2.log last 20 lines:
PM2 | 2019-01-31T12:27:39: PM2 log: Process dump file : C:\Users\jesse\.pm2\dump.pm2
PM2 | 2019-01-31T12:27:39: PM2 log: Concurrent actions : 2
PM2 | 2019-01-31T12:27:39: PM2 log: SIGTERM timeout : 1600
PM2 | 2019-01-31T12:27:39: PM2 log: ===============================================================================
PM2 | 2019-01-31T12:27:43: PM2 log: PM2 successfully stopped
PM2 | 2019-01-31T12:27:47: PM2 log: ===============================================================================
PM2 | 2019-01-31T12:27:47: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2 | 2019-01-31T12:27:47: PM2 log: Time : Thu Jan 31 2019 12:27:47 GMT-0500 (Eastern Standard Time)
PM2 | 2019-01-31T12:27:47: PM2 log: PM2 version : 3.2.9
PM2 | 2019-01-31T12:27:47: PM2 log: Node.js version : 11.7.0
PM2 | 2019-01-31T12:27:47: PM2 log: Current arch : x64
PM2 | 2019-01-31T12:27:47: PM2 log: PM2 home : C:\Users\jesse\.pm2
PM2 | 2019-01-31T12:27:47: PM2 log: PM2 PID file : C:\Users\jesse\.pm2\pm2.pid
PM2 | 2019-01-31T12:27:47: PM2 log: RPC socket file : \\.\pipe\rpc.sock
PM2 | 2019-01-31T12:27:47: PM2 log: BUS socket file : \\.\pipe\pub.sock
PM2 | 2019-01-31T12:27:47: PM2 log: Application log path : C:\Users\jesse\.pm2\logs
PM2 | 2019-01-31T12:27:47: PM2 log: Process dump file : C:\Users\jesse\.pm2\dump.pm2
PM2 | 2019-01-31T12:27:47: PM2 log: Concurrent actions : 2
PM2 | 2019-01-31T12:27:47: PM2 log: SIGTERM timeout : 1600
PM2 | 2019-01-31T12:27:47: PM2 log: ===============================================================================
Same for me install with yarn global add pm2 inside docker image installation:
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
/usr/local/share/.config/yarn/global/node_modules/pm2/lib/completion.js:191
var file = '.' + process.env.SHELL.match(/\/bin\/(\w+)/)[1] + 'rc',
^
TypeError: Cannot read property 'match' of undefined
at readRc (/usr/local/share/.config/yarn/global/node_modules/pm2/lib/completion.js:191:38)
at install (/usr/local/share/.config/yarn/global/node_modules/pm2/lib/completion.js:143:3)
at Object.complete (/usr/local/share/.config/yarn/global/node_modules/pm2/lib/completion.js:27:26)
at checkCompletion (/usr/local/share/.config/yarn/global/node_modules/pm2/bin/pm2:153:17)
at /usr/local/share/.config/yarn/global/node_modules/pm2/bin/pm2:216:7
at /usr/local/share/.config/yarn/global/node_modules/pm2/lib/API.js:186:16
at /usr/local/share/.config/yarn/global/node_modules/pm2/lib/API/Modules/Modularizer.js:78:19
at /usr/local/share/.config/yarn/global/node_modules/async/internal/once.js:12:16
at replenish (/usr/local/share/.config/yarn/global/node_modules/async/internal/eachOfLimit.js:61:25)
at /usr/local/share/.config/yarn/global/node_modules/async/internal/eachOfLimit.js:71:9
SHELL=/bin/bash pm2 completion install
Will help to fix
Setting the variable manually just leads to a path argument must be of type string. Received type undefined later on.
I encounter the same issue. Then again when I try to run SHELL=/bin/bash pm2 completion install
I end up with the following error
^
TypeError: Cannot read property '1' of null
at readRc (C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:191:59)
at install (C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:143:3)
at Object.complete (C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\completion.js:27:26)
at checkCompletion (C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\bin\pm2:153:17)
at C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\bin\pm2:216:7
at C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\API.js:182:16
at C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\Client.js:53:16
at Timeout._onTimeout (C:\Users\vijay\AppData\Roaming\npm\node_modules\pm2\lib\Client.js:362:9)
Could someone please help on this. Is this because pm2 expects the bash to be present which is not available in windows platform? is there a way to get over this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.