Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localhost:3000 Version Displayed Differently from Heroku Deployed Version - Node.js

I've deployed my directory to Heroku using git push heroku master, but nothing happens.... Everything up-to-date is what the screen reads.

How can I push to Heroku the exact version that I am running locally, since the local version does the things I want?

like image 295
maudulus Avatar asked Sep 07 '18 04:09

maudulus


Video Answer


2 Answers

If you are sure that the source codes itself are not the same in these two branches, you can use force push:

# Make sure you are on your local master branch
git branch
# Make sure that your remote address is correctly set
git remote -v
# Then force push your master branch to heroku remote master branch
git push heroku master -f

force pushing a branch to a remote will force the remote branch to take on the branch’s code and git commit history

But if you don't have access to check the source code, check if Environment Variables are the same on local machine and server or not (e.g. NODE_ENV variable)

Moreover, Double check automatic deployment of heroku (if exists) as well as the node and npm version of both machines and be aware of the command you run on both machines (npm start or node . or ...) that may have different operations based on envs or so.

like image 179
Amir Masud Zare Bidaki Avatar answered Oct 08 '22 19:10

Amir Masud Zare Bidaki


Please check the branch or remote url of heroku.

In heroku click Deploy tab and find out the branch. Add the remote url in your local machine terminal.

1) heroku git:remote -a projectname
2) git status
3) git add .
4) git commit -m "message"
5) git push heroku master
like image 2
Vikash Dhiman Avatar answered Oct 08 '22 20:10

Vikash Dhiman