As in the package.json to determine the OS?

As in the package.json to determine the OS?
I run the app on VDS so:
$ pm2 start $PWD/server/app.js --watch $PWD
But work-at home I'm on WINDOWS 7. And in the package.have a json record:
"scripts": {
 "start": "pm2 start ./server/app.js --watch ."
}

I can't use $PWD on the Windows? Is there a way to specify a line of starting as something cross-platform?
July 9th 19 at 11:26
3 answers
July 9th 19 at 11:28
Solution
Why actually do this(run the application) needs to do package.json?

For this is another soft and/or hands.
I mastered only in Linux VDS and took to practice. Just used to write npm start than the team that I cited above. PM2 to start/restart/stop application of the rules or advise something? - Kameron_Hilpert34 commented on July 9th 19 at 11:31
: like anything, I use supervisor. - bailee_Stant commented on July 9th 19 at 11:34
July 9th 19 at 11:30
Solution
make config for pm2 as a json file and run through it
if in the config to set the name, then later you can run through it
What kind of config? You can link to an example? - Kameron_Hilpert34 commented on July 9th 19 at 11:33
: pm2.keymetrics.io/docs/usage/application-declaration - bailee_Stant commented on July 9th 19 at 11:36
July 9th 19 at 11:32
Solution
I usually do npm start in the prod and that the thread like npm run dev on a development machine. The more that the prod I have supervisord to develop is not very convenient.
And do not tell what could be? If using node script.js to start, it works. If using pm2 script.js then 502 Bad gatway. Working through Nginx proxy - Kameron_Hilpert34 commented on July 9th 19 at 11:35
: 502 means that nginx was no answer. First check that the config ngninx the correct port is specified in the section upstream. Then check that under the pm2 app rises — look in the logs. Is that directly the app starts up, and under the Manager does not want. - bailee_Stant commented on July 9th 19 at 11:38
: Yes, in the logs there are no errors in that case. In General, while forever zayuzat. After upgrading the repository and restart forever app.js everything works. Go Linux basics to read. - Kameron_Hilpert34 commented on July 9th 19 at 11:41

Find more questions by tags LinuxNode.jsWindows