Open joeyfurness opened 4 years ago
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.
Have anything about this my friend? Stuck here also...
In my case, the services keep running (with no restarts), but logging es6 syntax errors. Pretty weird.
Occours only in an CentOS server, actually.
I was having an issue with PM2 5.1.2 on CentOS servers as well. I was able to finally get this to work by adding
interpreter: "babel-node"
to the ecosystem.config.js file
Edit: Nevermind. I didn't notice you were already including that option. Hopefully this can help someone else with a similar issue.
module.exports = {
apps: [
{
name: "myapp",
watch: true,
script: "npx babel-node index.js", // apply babel-node
env: {
PORT: 3000,
NODE_ENV: "staging",
},
},
],
};
What's going wrong?
babel-node
doesn't transpile properly when launching app with a config.js file. Using CLI arguments works, ex:pm2 start --interpreter babel-node app.js
.When launching from the config.js file, what's weird is that when I run
pm2 info app
it says that the interpreter isbabel-node
, however I still get errors on my ES6 syntax. When launching with CLI arguments, it appears everything is transpiling correctly and no errors are logged.How could we reproduce this issue?
The config file I use is:
The CLI command that works as expected is
pm2 start --interpreter babel-node app.js
Supporting information