1

I am using npm link to add my local modules into my app. It works totally fine on my local machine, but when I run grunt and push it to Heroku, it says my module is not found!!

I have everything in one single repo. Should I pay $7/month for NPM private repositories? Thats my last resort...

Any ideas how to get this working?

P.S. publishing my private modules into public NPM is not an option, it is a database schemas module used throughout multiple apps. I didn't want to copy and paste my database schemas everywhere

Copying the local modules manually into node_modules is also not an option because of Windows filename size limit for Git:

fatal: unable to stat : Filename too long
Use --force to continue.
Dolan
  • 1,519
  • 4
  • 16
  • 36

1 Answers1

1

I am using npm link to add my local modules into my app. It works totally fine on my local machine, but when I run grunt and push it to Heroku, it says my module is not found!!

Of course it does - link just makes a local symlink to another directory on your machine. How would Heroku get access to files outside of your project on your local hard disk?

If you don't want to pay for private npm hosting, but you don't want to publish your modules publicly on npm or github, you can use bitbucket to publish them via git and use npm's git support to pull them into your apps. It's a bit of a messy hack to save $7 though.

hunterloftis
  • 13,386
  • 5
  • 48
  • 50
  • Ah yes, that did the trick. Thank you for your advice. I followed this stack-overflow: http://stackoverflow.com/questions/23210437/npm-install-private-github-repositories-by-dependency-in-package-json – Dolan Oct 20 '15 at 14:07