pm2

React URLs are not Accessible

一个人想着一个人 提交于 2019-12-25 01:27:25
问题 hi i've run following command pm2 start process.json on ec2 AWS. Here is my process.json file { "script": "serve", "env": { "PM2_SERVE_PATH": './build', "PM2_SERVE_PORT": 5000 } } When I run the pm2 command shown above. I can access the Base URL. But when I type the Sub URLs from browser, it shows a page that contains 404 |The requested path cannot be found. Below is my file structure I am generating the project using npm run build then pm2 start process.json 回答1: So the app starts up and you

How to run multiple app using PM2?

≡放荡痞女 提交于 2019-12-24 11:59:28
问题 I want to run my angular4 app using PM2 it will run but when I am close the terminal it will stop. On this server already run one application, it is working properly, but in my app it will work when I am open the terminal, otherwise it will stop pm2 start server.js I am using this command to run my app but when I am Close the Terminal immediately it will stop, so how can I run this app Forever using PM2. 回答1: If you are using PM2 properly, your applications should not be turning off after

No Request Status in Node.js Morgan Logging

╄→尐↘猪︶ㄣ 提交于 2019-12-24 00:58:12
问题 I'm running a node.js app on an Azure VM (with PM2 handling load balancing and restarting). Here's the server set up and logging code: var logger = require('morgan'); var app = express(); app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(flash()); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes);

Meteor app ran with pm2 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

本秂侑毒 提交于 2019-12-23 20:16:36
问题 I am using meteor. I build my app with meteor build . Then I try to run it with pm2 MONGO_URL=mongodb://localhost:27017/btctestdb PORT=3000 ROOT_URL=http://myurl METEOR_SETTINGS=$(cat /home/app/settings.json) pm2 start main.js & And I get this error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 1: node::Abort() [node /home/app/unbundled/built/p3001/1.10.0/bundle/v1.10.0atp3001.js] 2: 0x12190dc [node /home/app/unbundled/built/p3001/1.10.0/bundle/v1.10

Kill a Docker Container

我与影子孤独终老i 提交于 2019-12-23 09:49:03
问题 I've set up a Docker container for my node app and ran it using docker run -p 4500:4500 my_node_app It launched pm2 in no-daemon mode. CTRL+C and exit don't work. I've tried docker stop my_node_app in another terminal window but to no avail. Appreciate any help. 回答1: You will be able to see currently running docker containers using below command. docker ps Then copy the CONTAINER ID of the running container and execute the following command docker stop <container_id> Please replace with a

How can I run pm2 on a certain node version?

耗尽温柔 提交于 2019-12-23 07:38:27
问题 There are several different versions of node running on our linux server, And my service is based on node v0.11.14. However, other people's code have to run on lower version of node(lower than v0.11) otherwise their services will be out of service. So I can't define the global node version as v0.11. I just want to run pm2 to monitor my service based on node v0.11. Is there anyway to run my pm2 on node v0.11 without changing the global node version? Thanks 回答1: Use pm2 and specify node version

How can I run pm2 on a certain node version?

二次信任 提交于 2019-12-23 07:34:56
问题 There are several different versions of node running on our linux server, And my service is based on node v0.11.14. However, other people's code have to run on lower version of node(lower than v0.11) otherwise their services will be out of service. So I can't define the global node version as v0.11. I just want to run pm2 to monitor my service based on node v0.11. Is there anyway to run my pm2 on node v0.11 without changing the global node version? Thanks 回答1: Use pm2 and specify node version

nodejs api not working after socket hangup and gets resolved automatically

馋奶兔 提交于 2019-12-23 03:28:14
问题 Nodejs api not working after socket hangup and gets resolved automatically.I have also added res.end() while sending the response Also added connection:close header in request so as to tell server to close connection after sending the response .This error occurs UNCEREMONIOUS and gets resolved automatically but it blocks some of the trailing apis. #!/usr/bin/env node var app = require('../app'); var debug = require('debug')('rkdemo:server'); var http = require('http'); var port =

Passing environment variables to node.js using pm2

試著忘記壹切 提交于 2019-12-23 02:52:16
问题 I am trying to pass some arguments to my Express application which is run by pm2. There wasn't any hint in their documentation to do so, but apparently it's possible to pass some EV to your node application like SOME_STUFF=xxx pm2 start app.js . 回答1: It's actually possible and I'm pretty sure it was in PM2's documentation some time ago. Anyways, that's what you need to do: pm2 start app.js -- -some_stuff xxx Basically, add -- and then you can add your own app parameters. Managed to find the

bash: pm2: command not found

孤人 提交于 2019-12-22 14:56:08
问题 I can't run pm2 on ubuntu box. I'm not sure what's the problem. The pm2 is installed globally. npm list -g --depth=0 /opt/nodejs/lib ├── forever@0.15.3 ├── node-gyp@3.4.0 ├── npm@2.15.9 ├── pm2@2.1.5 ├── userdown@0.2.1 └── wait-for-mongo@0.2.0 But I still get pm2 -bash: pm2: command not found if I run other app userdown Starting Script is not provided versions node v4.5.0 npm v2.15.9 log from installation: sudo npm install pm2 -g npm WARN optional dep failed, continuing fsevents@1.0.15 /opt