Why does this dependency error occur on Linux but not Windows?

In my Node.js code, I am getting the following error when running on Linux, but not on my window machines. I am not changing the structure of the files in between. Why is this happening?

Error: Cannot find module './app/helpers/textHelper.js'
   at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/bdu/work/srid_tool/server.js:3:17)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)"

      

+3


source to share


1 answer


The typical answer here is that the capitalization of a path is not exactly the same on a string as it is on a filesystem. Most * nix filesystems are case sensitive; There are no standard Windows file systems.



So, for example, if the actual directory app/Helpers

or the actual file name texthelper.js

, it will not be a case-matched match for that string.

+3


source







All Articles