简体   繁体   中英

Error: Cannot find module, but only on Heroku

My application runs just fine locally, and on a Travis CI build server but when its on Heroku

I get Error: Cannot find module and the app crashes.

Some facts about the npm module

  • it lives on github
  • its a private repo
  • its accessed like this "my_module": "git+https://MY_KEY:x-oauth-basic@github.com/me/my_module#develop"

Edit:

It seems that Heroku is erroneously removing my module after the build

-----> Pruning unused dependencies
   unbuild my_module@0.0.7
-----> Caching node_modules directory for future builds

It turns out this was due to my local dev machine (OSX) not being fussy about the casing of file paths whereas Heroku (linux) is.

My module was installed to node_modules/mymodule instead of node_modules/myModule as it should have been.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM