2

I am trying to deploy my node-express website on heroku. Everything works fine, but just one problem.

I have used express-stormpath as a dependency in my project, which i have customized(the views only).

When I deploy this to heroku, using git push heroku master, the node_module is ignored while uploading and all the modules are installed by heroku itself using npm. So my customization to the node module is not reflected at heroku.

I have tried this also: npm install private github repositories by dependency in package.json

Any suggestions on how to upload whole project including the node_modules to heroku?

Community
  • 1
  • 1
Naeem Shaikh
  • 15,331
  • 6
  • 50
  • 88

1 Answers1

2

If you're using express-stormpath, you should not be customizing the views inside of node_modules -- this is the wrong way to do it. Instead you should be putting your custom views inside of your own 'views' folder, and telling express-stormpath where that file is.

Here's an example of a custom login view, for instance:

app.use(stormpath.init(app, {
  loginView: __dirname + '/views/login.jade',
  // ...
}));

If you take a look at the express-stormpath docs here: https://docs.stormpath.com/nodejs/express/product.html#update-template-paths (it shows you how to do this).

NOTE: I'm the author of express-stormpath and I randomly saw this question ^^ Hope this was helpful!

rdegges
  • 32,786
  • 20
  • 85
  • 109
  • Ok.. Thats something true.. But still if using any customized module? – Naeem Shaikh Apr 19 '15 at 05:18
  • Just curious because i need to customize few other modules as well. – Naeem Shaikh Apr 19 '15 at 08:08
  • If you need to customize another model you should creeate a local module (don't put it in node_modules), put it on a web server, and have npm install it via tarball directly. – rdegges Apr 20 '15 at 00:21
  • This is the correct answer. node_modules is a generated directory (generated by npm install). You should not modify it by hand (your modifications will just get destroyed). – hunterloftis Apr 23 '15 at 23:21