我已经使用 git push heroku master 将我的目录部署到 Heroku,但是没有任何反应...。最新的一切 就是屏幕上显示的内容。
我如何才能将我在本地运行的确切版本推送到 Heroku,因为本地版本可以执行我想要的操作?
最佳答案
如果您确定这两个分支中的源代码本身不相同,您可以使用强制推送:
# 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
但如果您无权检查源代码,请检查本地计算机和服务器上的环境变量是否相同(例如NODE_ENV变量)
此外,仔细检查 heroku 的自动部署(如果存在)以及两台机器的 Node 和 npm 版本,并注意您在两台机器上运行的命令(npm start 或 node . 或 ...) 可能有基于 envs 的不同操作。
关于javascript - 本地主机 :3000 Version Displayed Differently from Heroku Deployed Version - Node. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52215253/