0
votes

I have reactjs project that need to be run on the linux server. Whenever I run the app on server using "sudo npm run lin_stage_server" it seems to be working fine on 80 port. when I tried to run app through pm2 with command "sudo pm2 start npm -- lin_stage_server" its not working for me.

In addition to the above command i also tried
"sudo pm2 start npm -- BRANCH_ENV=stage NODE_ENV=production PORT=80 node appserverstart.js "

Please help !

----- Error details ------

Error details

----- Package.json -----

Package.json

----- appserverstart.js -----

appserverstart.js

-------Additional info------- server: CentOS Linux version 7 core, npm version: 6.4.1, pm2 version: 3.5.1, node version: 8.11.1,

1
Please add text, not screenshots. meta.stackoverflow.com/questions/285551/…str

1 Answers

0
votes

You are not passing run to npm:

pm2 start npm -- run lin_stage_server

pm2 start npm -- lin_stage_server is effectively npm lin_stage_server.

pm2 start npm -- run lin_stage_server is effectively npm run lin_stage_server