Answer the question
In order to leave comments, you need to log in
How to properly run Pm2 from Ubuntu/Linux?
If you write:
pm2 start app.js - everything starts and works as it should,
but if you do:
pm2 start /home/{projectname}/app.js
then a mountain of errors related to the application paths falls ...
How to make it understand where the application root is ?
Answer the question
In order to leave comments, you need to log in
It is necessary to build a project relative to the executable file, put all the paths in the config, for example.
var __project = exports.__project = path.join(__dirname, '../')
, __app = exports.__app = path.join(__project, app)
, __configs = exports.__configs = path.join(__project, 'config')
, __helpers = exports.__helpers = path.join(__app, 'helpers')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question