Nick
Nick

Reputation: 1934

Heroku App is Not Using the Right Node Module

I'm trying to test a fork of a node module on my Heroku app. Here's what I did:

  1. Forked a node module repo and made some changes to the code. Pushed to my own remote repo.
  2. Ran the following on my Heroku bash terminal:

npm install git+https://[email protected]/Nsrose/node_model_updated.git

  1. Ran heroku restart.

This actually updated the file I edited under node_modules/ folder. However, the error that was fixed with this file change is not changing. Before the npm install, the app said this error:

ERROR TypeError: Cannot read property 'channel' of undefined (line 97)

After the series of commands above, even though the file is updated on the heroku server under node_modules/, the error persists. In fact, the file I changed now doesn't even have anything related to 'channel' on line 97.

Why is my heroku app still using the old node_module/ and how do I force it to update?

Upvotes: 2

Views: 153

Answers (1)

Alan
Alan

Reputation: 379

To run node.js application in heroku you need a "Procfile" with no extension, there you write the command heroku has to run to get your app running, this file has to be your main git folder for example

web: node app.js

So after cloning the git repository, saving your changes and testing locally, all you have to do is:

  • git add .
  • git commit -m "message"
  • git push heroku master

I'll leave a link to Getting started with Node on Heroku

EDIT: Also your undefined is probably a code problem not heroku's

Upvotes: 1

Related Questions