Meteor Deployment - how upgrade aplication

Hi,

I use for deployment:
nginx as a reverse proxy web server which passes requests to our application;
mongodb;
pm2 – A production process manager that keeps an eye on our application, and restart it if it crashes

I implemented the applications on my own server, using the information contained under the link: https://scotch.io/tutorials/building-a-slack-clone-in-meteor-js-part-5-deployment

I want to ask how update the production version of the application ( adding more packages from the page https://atmospherejs.com/ and changing the code in the same application).

I replace application files and restarts pm2 job by running pm2 restart all
After launching the application I have a bug with server nginx “502 Bad Gateway”.

I would be grateful for any help or links to material that solve my problem.