Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Let's get this Express.js Flashcard App deployed to Heroku :)

Here's my app as it is now. As you can see, despite many, many attempts to deploy the app which has been modified a fair bit from the original solution, admittedly... I still cannot successfully deploy it on Heroku.

https://jgdm-flashcard-app.herokuapp.com/

Not even the error logs are helping me anymore.

$ heroku logs --tail
C:\file\path\goes\here\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

The deployment itself has worked as it always reports "build succeeded" but I can't see what's making it error. I'm desperate to get this app online. I've looked and looked, tried and tried and I just don't get it!.

Feel free to clone the repository for a closer look if you need it https://github.com/jg-digital-media/express_site.git

3 Answers

Sheila Anguiano
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sheila Anguiano
Full Stack JavaScript Techdegree Graduate 35,239 Points

Hello!!

I understand your pain, I fought a lot with it, but I finally got it running in Heroku:

The things that I had to change were:

  1. Change the port information in app.js (which I think might be your problem in line ~70 of your app.js file)
  2. Add the "start": "node app.js" in the package.json file

I notice that you added more routes, so I don't know if that is causing extra problems, but if it works locally, maybe that simple change can solve the issue. I hope it helps :)

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

I've done it!!!

I've released the app on Heroku!! :)

It looks like the issue was a wrongly cased Procfile. I had one local repo where I did most of the development that was named "Procfile" which is correct. But my laptop had "procfile" and that was the version on the remote repo.

Looks like that's what was causing it the whole time!

Thanks for your help!

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Sheila, :)

Thanks for taking the time to reply to the thread. I'm glad you got your version of the app working.

Unfortunately, the port solution that worked for you hasn't in my instance. However I'm sure it should be and it's a good solution, so I'm keeping it. :)

My next plan I suppose is to delete any versions of the app I have on Heroku and start again as if it was a new app, keeping the edits your suggested.

I tried on my PC and laptop of it's a complete Rabbit hole of problems lol My PC no longer recognises Heroku at all for some reason and the local repo on my Laptop is looking for a Heroku app that no longer exists.

One problem after the other. Thanks for trying! :-)