The problem is pm2 finding verdaccio in the first place. That's why using which solves it, but that is not always possible in Windows.
I've managed to run verdaccio in pm2 on Windows, without even installing it globally (so that I could commit my configs, plugin packages, etc), with this:
// ecosystem.config.js
module.exports = {
apps : [{
name: 'verdaccio',
script: './node_modules/verdaccio/build/lib/cli', // local package, that pm2 can run with "node <script>"
args : '--config ./config.yaml', // local confis
node_args: '-r esm', // verdaccio's package didn't contain "type": "module"
exec_mode: 'fork' // verdaccio does not currently support PM2's cluster mode
}]
}
The problem is pm2 finding verdaccio in the first place. That's why using
which
solves it, but that is not always possible in Windows.I've managed to run verdaccio in pm2 on Windows, without even installing it globally (so that I could commit my configs, plugin packages, etc), with this:
PS.: these are my dependencies: