pm2-githook > La syntaxe du nom de fichier, de repertoire ou de volume est incorrecte
Bonjour, I have some time to go deeper in my githook config and solve the problems on my Windows serveur . When Github deliver a webhook, pm2 githook receives it but have an error you can see in pm2 monitor :
pm2-githook > [2022-06-30T12:09:47.072Z] Received valid hook for app myapp-v2│ ││ pm2-githook > [2022-06-30T12:09:47.784Z] An error has occuring while processing app apiv2 │ ││ pm2-githook > Error: Command failed: cd 'C:\sitesc\serveurapi-v2/';LC_ALL=en_US.UTF-8 git │ ││ pm2-githook > La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte. │ ││ pm2-githook > at ChildProcess.exithandler (node:child_process:399:12) │ │ ││ pm2-githook > at ChildProcess.emit (node:events:520:28) │ │ ││ pm2-githook > at ChildProcess.emit (node:domain:475:12) │ │ ││ pm2-githook > at maybeClose (node:internal/child_process:1092:16) │ │ ││ pm2-githook > at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { │ │ ││ pm2-githook > killed: false, │ │ ││ pm2-githook > code: 1, │ │ ││ pm2-githook > signal: null, │ │ ││ pm2-githook > cmd: "cd 'C:\\sitesc\\serveurapi-v2/';LC_ALL=en_US.UTF-8 git config --get │ │ ││ pm2-githook > }
in the ecosystem.json , for this app , I have put : ` module.exports = { apps : [{ name : "apiv2", script : "./apiv2.js", cwd: "/sitesc/serveurapi-v2",
watch: true,
env: {
NODE_ENV: "production",
PORT: "8082",
},
max_restarts: 10,
}, ... ` I do not understand where this path syntax is coming from ! Why the "c:" is added? (It is on c:) , why the "'" are added, and the "//" !!
thank you !
I believe this is a windows behavior of node, its possible that the module doesn't work on windows since it developed it against linux only. Feel free to make a PR if you find a solution
I do not know the solution, but ecosystem.config.json is well read by pm2 on windows , so it could work..