2

I have a node app that has a local npm module npm link ./local and I'm trying to deploy the app to heroku. Heroku runs npm install when I deploy, but npm link's aren't saved in package.json so my local module is missing.

I'm new to heroku and Procfiles, I'd like to run a script or just run npm link ./local before on the heroku box.

Alternatively I could put the module on github as a private repository and link it from there. But as far as I know Heroku isn't able to download private repo. Can I give Heroku access to my github repository via keys so that it could download it?

I'd love for somekind of solution! Anything!

ThomasReggi
  • 55,053
  • 85
  • 237
  • 424

1 Answers1

2

I think you need yo put modules in node_modules folder and push that to heroku

Procfiles are easy to maintain and heroku will read that

I have sample Procfile like

web: bin/hubot -a campfire

Even heroku also says that best is to include node_modules into repo so you can just include your local packages into that.

See more here Heroku Node Deploy

arunagw
  • 1,193
  • 6
  • 8
  • 2
    I guess that would do the trick. Something about not git-ignoring `npm_modules` makes my brain fart. – ThomasReggi Oct 18 '13 at 22:19
  • So I don't think that git is following my `npm link` aka `symlink`. I don't think it's safe to put my actual code inside `node_modules`. Do you have any idea how to fix this? – ThomasReggi Oct 18 '13 at 22:31
  • So I got it to work, `npm link` dosn't link it relative like I thought It did so I had to `cd` into `node_module` and `ln` directly. `node_modules$ ln -s ../local_module/ ./local_module` – ThomasReggi Oct 18 '13 at 22:50