You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Require is not case insensitive on linux but is on windows #14019
I had a file at the following folder location: .../gameSignups/create.js
and it windows I was able to (it didn't fail so I missed the typo) call require(".../gameSignUps/create"); however this failed with a module not found when I moved to over to the production linux enviroment.
This is another reason why the developer should venture to minimize the difference in environments between development and production. There are a lot more platform-dependent quirks, both related to the file system and not, that could be hard to foretell.
name all your files lowercase, the same problem happens with OSX / MacOS. When would you want this warning? For every file access for every file on Windows and MacOS? :)
@Nokel81 just for clarity - every time you access a file, case sensitivity/insensitivity will come into play, so you would get thousands of warnings. your typical program is accessing thousands, if not millions, of files per second :)
require uses InternalModuleStat which makes it impossible to check whether the module could have been loaded on a case-sensitive filesystem / operating system without additional disk accesses. You can do the checking yourself, but we are not going to implement this in the core.
Activity
cjihrig commentedon Jul 1, 2017
This is related to the underlying file system, not Node itself.
TimothyGu commentedon Jul 1, 2017
This is another reason why the developer should venture to minimize the difference in environments between development and production. There are a lot more platform-dependent quirks, both related to the file system and not, that could be hard to foretell.
mscdex commentedon Jul 1, 2017
Yep, this is working as intended.
Nokel81 commentedon Jul 1, 2017
Okay, would there be anyway for this to log some sort of warning for file systems that allow this sort of insensitivity?
ORESoftware commentedon Jul 1, 2017
name all your files lowercase, the same problem happens with OSX / MacOS. When would you want this warning? For every file access for every file on Windows and MacOS? :)
Nokel81 commentedon Jul 1, 2017
Sure, I do try to do that. No only an access when the case insensitivity comes into play
TimothyGu commentedon Jul 1, 2017
So… every file access for every file on Windows and macOS? :D
ORESoftware commentedon Jul 1, 2017
@Nokel81 just for clarity - every time you access a file, case sensitivity/insensitivity will come into play, so you would get thousands of warnings. your typical program is accessing thousands, if not millions, of files per second :)
bnoordhuis commentedon Jul 1, 2017
Answered, closing.
tniessen commentedon Jul 1, 2017
requireuses InternalModuleStat which makes it impossible to check whether the module could have been loaded on a case-sensitive filesystem / operating system without additional disk accesses. You can do the checking yourself, but we are not going to implement this in the core.