简体   繁体   English

错误:找不到模块,仅在Heroku上

[英]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 我的应用程序在本地和Travis CI构建服务器上运行良好,但是在Heroku上运行时

I get Error: Cannot find module and the app crashes. 我收到Error: Cannot find module ,应用程序崩溃。

Some facts about the npm module 关于npm模块的一些事实

  • it lives on github 它住在github上
  • its a private repo 它是私人回购
  • its accessed like this "my_module": "git+https://MY_KEY:x-oauth-basic@github.com/me/my_module#develop" 它的访问方式如下"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 似乎Heroku在构建后错误地删除了我的模块

-----> 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. 事实证明,这是由于我的本地开发机(OSX)对文件路径的大小写不屑一顾,而Heroku(linux)却如此。

My module was installed to node_modules/mymodule instead of node_modules/myModule as it should have been. 我的模块已安装到node_modules/mymodule而不是应该安装的node_modules/myModule

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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