pm2

Why pm2 ignored the --experimental-modules passed to node in the ecosystem.config.js file?

不羁的心 提交于 2020-08-07 08:03:06
问题 This is my main.js file: import Koa from "koa"; const app = new Koa(); app.use(async ctx => ctx.body = "Hello, World!"); app.listen(3000); This is my package.json file: { "type": "module", "name": "koa-sandbox", "version": "1.0.0", "description": "", "main": "./src/main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node --experimental-modules ./src/main.js" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "koa": "^2.7.0" } } It works

Is PM2 meant to be used during development process?

那年仲夏 提交于 2020-06-27 17:13:45
问题 I'm starting with Node.js world and I noticed that node process doesn't restart automatically. Searching around I found that nodemon can do that work but I also found that PM2 is an alternative to nodemon. So should I try PM2 for development or just leave it for production and use nodemon for development (which seems very easy to setup)? 回答1: A node process should not restart unless told to do so. You can use PM2 for development with the watch feature - similar results to nodemon . I

What is the default location of PM2 log files?

喜你入骨 提交于 2020-06-13 19:08:32
问题 I'm trying to find out where PM2 saves the log files by default? I'm working with a Linux Ubuntu 16.04 server and I've installed it globally with npm i pm2 -g . 回答1: pm2 saves logs to $HOME/.pm2/logs/XXX-err.log by default, where XXX is your pm2 app name 回答2: I wanted to see the logs for different processes. There is a console-based UI for this: pm2 monit Extra tips for pm2 newbies: Launch multiple, co-ordinated, instance per cpu core with: pm2 start myApp.js -i max Beware the 'js' example of

What is the default location of PM2 log files?

狂风中的少年 提交于 2020-06-13 19:05:14
问题 I'm trying to find out where PM2 saves the log files by default? I'm working with a Linux Ubuntu 16.04 server and I've installed it globally with npm i pm2 -g . 回答1: pm2 saves logs to $HOME/.pm2/logs/XXX-err.log by default, where XXX is your pm2 app name 回答2: I wanted to see the logs for different processes. There is a console-based UI for this: pm2 monit Extra tips for pm2 newbies: Launch multiple, co-ordinated, instance per cpu core with: pm2 start myApp.js -i max Beware the 'js' example of

How to use pm2 startup command on Mac?

旧时模样 提交于 2020-06-12 04:14:28
问题 My question is the same as How to use pm2 startup command on Debian platform? but i need to make it start on Mac OS (darwin) I only found a very bref documentation $ pm2 startup <ubuntu|centos|gentoo|systemd> What can I do? 回答1: PM2 now has darwin option for startup, so running: pm2 startup darwin should work. Also checkout this commit: 1. Make platform auto detecting. 2. Support darwin startup script. So right now, you can just call: pm2 startup and the script will recognise your OS. NOTE: I

How to use pm2 startup command on Mac?

こ雲淡風輕ζ 提交于 2020-06-12 04:14:18
问题 My question is the same as How to use pm2 startup command on Debian platform? but i need to make it start on Mac OS (darwin) I only found a very bref documentation $ pm2 startup <ubuntu|centos|gentoo|systemd> What can I do? 回答1: PM2 now has darwin option for startup, so running: pm2 startup darwin should work. Also checkout this commit: 1. Make platform auto detecting. 2. Support darwin startup script. So right now, you can just call: pm2 startup and the script will recognise your OS. NOTE: I

How to use pm2 startup command on Mac?

霸气de小男生 提交于 2020-06-12 04:14:06
问题 My question is the same as How to use pm2 startup command on Debian platform? but i need to make it start on Mac OS (darwin) I only found a very bref documentation $ pm2 startup <ubuntu|centos|gentoo|systemd> What can I do? 回答1: PM2 now has darwin option for startup, so running: pm2 startup darwin should work. Also checkout this commit: 1. Make platform auto detecting. 2. Support darwin startup script. So right now, you can just call: pm2 startup and the script will recognise your OS. NOTE: I

express server port configuration issue with pm2 cluster mode

十年热恋 提交于 2020-06-11 20:09:44
问题 Problem: We start pm2 in cluster mode, and pm2 starts as many processes as there are cpu cores, pm2 also tries to start as many node servers as there are cpu cores but the problem here is that it fails to start as many servers because they all try and start on the same port that is 3000, which already gets occupied by the first node server We using nginx and proxy it to 3000 port. we are using pm2 in cluster mode with the following configuration: { "apps" : [{ "script" : "npm", "instances" :

express server port configuration issue with pm2 cluster mode

故事扮演 提交于 2020-06-11 20:07:35
问题 Problem: We start pm2 in cluster mode, and pm2 starts as many processes as there are cpu cores, pm2 also tries to start as many node servers as there are cpu cores but the problem here is that it fails to start as many servers because they all try and start on the same port that is 3000, which already gets occupied by the first node server We using nginx and proxy it to 3000 port. we are using pm2 in cluster mode with the following configuration: { "apps" : [{ "script" : "npm", "instances" :