Open borislee0227 opened 3 years ago
Hey man, glad to hear that this is helping you out.
I assume you use ssh to connect to your VPS. You then need to go to the root folder of the project.
Then you can do the following:
npm run build
cd dist
pm2 start main.js
pm2 startup
pm2 save
I have written this down without actually performing the commands myself. If you have any issues, please let me know.
Kind regards,
Raf
Hey man, glad to hear that this is helping you out.
I assume you use ssh to connect to your VPS. You then need to go to the root folder of the project.
Then you can do the following:
npm run build
cd dist
pm2 start main.js
pm2 startup
pm2 save
I have written this down without actually performing the commands myself. If you have any issues, please let me know.
Kind regards,
Raf
hello
To run pm2 correctly it is necessary to give pm2 start in the previous folder, if running within the dist it gives errors of missing environment variable.
the correct one would be
pm2 start dist/main.js --name main.js
This is a very helpful project for me, but I'm sorry, I am a novice in node.js, I have successfully set the environment variable permanently on my vps from google. But I can't find a way to make this project executable after I offline my vps. For example, when using PM2, I am not sure which file PM2 needs to be set on.
So what do I need to set up so that this project can be executed after I offline my vps? Whether you help me or not, I will be very grateful for your project.