I added a console.log(error) just before the line that was throwing the error and got this
Error: spawn npm ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn npm',
path: 'npm',
spawnargs: [ 'install', '@rpgjs/chat' ]
}
Which after researching seems to be a Windows-specific error that results when one tries to use childProcess.spawn('npm') on Windows. In this case, the name of the process should be npm.cmd. I have managed to solve this error for myself by changing 'npm' to 'npm.cmd', but the package author should look into correcting this upstream, as this will surely cause problems for other Windows users trying to install plugins.