# Node app get application error in heroku

**URL:** <https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325>\
**Category:** General\
**Created:** [June 15, 2018, 12:08pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325 "2018-06-15T12:08:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![victornice](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@victornice](https://forum.freecodecamp.org/u/victornice)\
**Post date:** [June 15, 2018, 12:08pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/1 "2018-06-15T12:08:53Z")

</div>

I’ve deployed my node app via github but i get error in the log

 ![Screenshot%20from%202018-06-15%2013-59-53](https://global.discourse-cdn.com/freecodecamp/original/3X/3/b/3b0313f726b190a75f23ab1cb2bc105b5b59ae14.png)

this is the repo link:  
[https://github.com/victornice/knowledge-base](https://github.com/victornice/knowledge-base)

Thank you

---

<div class="post-metadata">

**Author:** ![victornice](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@victornice](https://forum.freecodecamp.org/u/victornice)\
**Post date:** [June 15, 2018, 12:14pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/2 "2018-06-15T12:14:32Z")

</div>

Now this is the error in the log

 ![Screenshot%20from%202018-06-15%2014-13-41](https://global.discourse-cdn.com/freecodecamp/original/3X/a/5/a55dcfffaa9979a4f9312eb237492b3985d44176.png)

---

<div class="post-metadata">

**Author:** ![s\_coder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/s_coder/32/26587_2.png) [@s\_coder](https://forum.freecodecamp.org/u/s_coder)\
**Post date:** [June 15, 2018, 2:56pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/3 "2018-06-15T14:56:55Z")

</div>

Does your app run locally and it’s just crashing on Heroku after being deployed?

Your app.use(express.static) statement looks sort of different from how I usually write it.

You might want to try:

```auto
// Point static path to public
app.use(express.static(path.join(__dirname, 'public')));

```

---

<div class="post-metadata">

**Author:** ![victornice](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@victornice](https://forum.freecodecamp.org/u/victornice)\
**Post date:** [June 15, 2018, 3:12pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/4 "2018-06-15T15:12:15Z")

</div>

It works fine locally  
I tried your solution but I still get error

 ![Screenshot%20from%202018-06-15%2017-11-44](https://global.discourse-cdn.com/freecodecamp/original/3X/4/5/45035b0213b16f530af03882f11616606058b3b7.png)

---

<div class="post-metadata">

**Author:** ![s\_coder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/s_coder/32/26587_2.png) [@s\_coder](https://forum.freecodecamp.org/u/s_coder)\
**Post date:** [June 15, 2018, 3:48pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/5 "2018-06-15T15:48:18Z")

</div>

I see. Are you sure you have all your dependencies in the package.json file that’s checked into the server? It’s failing at the start of the application.

---

<div class="post-metadata">

**Author:** ![s\_coder](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/s_coder/32/26587_2.png) [@s\_coder](https://forum.freecodecamp.org/u/s_coder)\
**Post date:** [June 15, 2018, 4:35pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/6 "2018-06-15T16:35:38Z")

</div>

Also, I am not sure you are seeing the real error message. Try typing heroku logs -n 200 in your console and look for a more detailed message regarding why your application is failing. That usually helps me when trying to debug why applications are crashing on heroku.

> **[Logging | Heroku Dev Center](https://devcenter.heroku.com/articles/logging)**
>
> Logs are a stream of time-stamped events aggregated from the output streams of all your app’s running processes. Retrieve, filter, or use syslog drains.

---

<div class="post-metadata">

**Author:** ![victornice](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@victornice](https://forum.freecodecamp.org/u/victornice)\
**Post date:** [June 15, 2018, 5:37pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/7 "2018-06-15T17:37:59Z")

</div>

![Screenshot%20from%202018-06-15%2019-35-15](https://global.discourse-cdn.com/freecodecamp/original/3X/3/2/323d76a10da6db0083ffc12fc52da3d8d7052adc.png) ![Screenshot%20from%202018-06-15%2019-35-48](https://global.discourse-cdn.com/freecodecamp/original/3X/a/c/ac24198868cf79414aceb0e8b39c360d7a2f6dde.png) ![Screenshot%20from%202018-06-15%2019-35-29](https://global.discourse-cdn.com/freecodecamp/original/3X/2/3/234f504bc48d898dc9a90e86b1eacadf8986e316.png) ![Screenshot%20from%202018-06-15%2019-36-04](https://global.discourse-cdn.com/freecodecamp/original/3X/6/a/6af2fee657dc80a02206f9b0efaaf31cddd2b5e8.png) ![Screenshot%20from%202018-06-15%2019-36-10](https://global.discourse-cdn.com/freecodecamp/original/3X/c/1/c1511161cf60a81edd076d89eabfcb506aee102f.png)

---

<div class="post-metadata">

**Author:** ![victornice](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@victornice](https://forum.freecodecamp.org/u/victornice)\
**Post date:** [June 15, 2018, 7:48pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/8 "2018-06-15T19:48:22Z")

</div>

After I had added a Procfile file and written in it (web: node app.js) I got this in the log

 ![Screenshot%20from%202018-06-15%2021-46-50](https://global.discourse-cdn.com/freecodecamp/original/3X/8/6/8681506d115ed9b838954c699b7bdb516411a865.png)

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:19pm UTC](https://forum.freecodecamp.org/t/node-app-get-application-error-in-heroku/200325/9 "2021-01-17T20:19:20Z")

</div>

Closed on January 17, 2021, 8:19pm UTC


