can pm2 specify ports
 if you directly use node server.js to specify the port number in the project, you can get 
 but in pm2, you will randomly assign a port number to me every time you restart 
 is there a way to assign the project port number 
 if you directly use node server.js to specify the port number in the project, you can get 
 but in pm2, you will randomly assign a port number to me every time you restart 
 is there a way to assign the project port number 
you can set the port number in the configuration file of pm2. Please refer to the official document: http://pm2.keymetrics.io/docs.
env is used in the project to define the environment in which the project runs, where the project uses three environments
 config
     config.development.json
     config.production.json 
     config.test.json
     index.jsindex.js
module.exports = require(require('path').join(__dirname, ['config', process.env.NODE_ENV || 'development', 'json'].join('.')));because the environment variables set in linux are environment variables in node_env, there is no problem using node server.js to run the project directly
the env used by the test server is test
-sharpcd ,--name --envNODE_ENV --watch
pm2 start server.js --name app --env test --watchC: Users aaa>npm install pm2 -g npm ERR! Unexpected end of input at 1:23103 npm ERR! false,"directories":{},"dist":{"shasum":"f8357e265f5768f2ca799a3241d1 npm ERR! ...
the express project has been configured with pm2 on the server and can be started successfully. The node port of express is 3000 now you can see the data under the corresponding node api by visiting http: 132.232.193.33:3000 about. My nginx currently...
download the project from the official website via git package.json npm nuxtpm2 ...
official documentation: http: pm2.keymetrics.io docs... npm install pm2-g installed successfully pm2 start app.js ...
Environment win7,node v8.11.3 pm2 v3.2.8 question I started the program with pm2, and the terminal display was successful, but there was no such process in pm list, and the program did not start. I have no problem booting with node. Excuse me, how...