Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying to Heroku using Node.js not working? #627

Open
NuroDev opened this issue Feb 11, 2017 · 6 comments
Open

Deploying to Heroku using Node.js not working? #627

NuroDev opened this issue Feb 11, 2017 · 6 comments
Labels
Milestone

Comments

@NuroDev
Copy link

NuroDev commented Feb 11, 2017

Been attempting to get a web app running on Heroku using NodeJS.
Used the provided recipe for setting it up: node-heroku .
However, the app builds correctly on Heroku, but when visiting the app page, it returns an application error.
Tested it with the configuration that I used and base configuration of all config options enabled(BDD & TDD). Still same issue.
Is it an issue with Heroku or the generator?

@NuroDev NuroDev changed the title Deploying to Heroku using Node.js doesn't work. Deploying to Heroku using Node.js not working? Feb 21, 2017
@NuroDev
Copy link
Author

NuroDev commented Feb 21, 2017

If more information is required, link to repository can be found here: github.com/Meadowcottage/KaplanSays. The dist files was made in the order provided by the deploying to heroku using node.js recipe.

I have checked the Heroku logs and the crash log returns the following:

2017-02-21T22:12:25.394968+00:00 heroku[web.1]: Starting process with command `npm start`
2017-02-21T22:12:28.366684+00:00 heroku[web.1]: Process exited with status 1
2017-02-21T22:12:28.384951+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-21T22:12:28.282442+00:00 app[web.1]: npm ERR! Linux 3.13.0-105-generic
2017-02-21T22:12:28.283226+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2017-02-21T22:12:28.283500+00:00 app[web.1]: npm ERR! node v7.5.0
2017-02-21T22:12:28.283773+00:00 app[web.1]: npm ERR! npm  v4.1.2
2017-02-21T22:12:28.285052+00:00 app[web.1]: 
2017-02-21T22:12:28.286543+00:00 app[web.1]: npm ERR! missing script: start
2017-02-21T22:12:28.286758+00:00 app[web.1]: npm ERR! 
2017-02-21T22:12:28.286908+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2017-02-21T22:12:28.287072+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2017-02-21T22:12:28.298997+00:00 app[web.1]: 
2017-02-21T22:12:28.299253+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-02-21T22:12:28.299393+00:00 app[web.1]: npm ERR!     /app/npm-debug.log

I double checked the dist/package.json and a start script is present.
Any ideas why this error may be occurring?

@silvenon
Copy link
Member

I don't use Heroku, but are you sure that package.json got deployed to Heroku? Is there any way to see that?

@NuroDev
Copy link
Author

NuroDev commented Feb 22, 2017

I have been looking into this more and I found the issue. The Heroku app by default tries to build from the root directory. Makes sense about the no script error now 😂.
Need to find a way to point Heroku to build from a sub directory or set the build directory.
If I do i'll make a PR.

@silvenon
Copy link
Member

silvenon commented Feb 22, 2017

If you see the very end of that recipe, it says that you should deploy only dist, so I'm guessing that should be your root. Is that possible to do?

@NuroDev
Copy link
Author

NuroDev commented Feb 22, 2017

I don't have a huge total use time with Heroku, but from what I have been working out is that you can instead point it to a branch to deploy from.
So best bet is to create a deployment branch and point Heroku to that branch to build from.

@silvenon
Copy link
Member

Yeah. In any case it appears that modifications to the recipe should be made. If you'd like to submit a PR once you get it working, that would be great. The simpler, the better. 😉

@silvenon silvenon added the docs label Feb 22, 2017
@UlisesGascon UlisesGascon added this to the v4.0.0 milestone Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants