If your Heroku deployment fails and you see some errors in your logs like this:
remote: SyntaxError: Unexpected token ...
or something related to the @hapi module, this typically means that there is a mismatch between the Node version used locally and the version Heroku is attempting to use. It can also mean that an outdated version is specified in the engines property of the package.json.
To resolve this:
1. Delete the package-lock.json file on both the client and server
2. Make sure that you are using at least the LTS version of Node locally
3. Make sure your local Node version matches what is shown in the package.json file's engines property.
4. Run the git add . , git commit -m "fixing versions" and git push heroku master commands to force a rebuild.