Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require is not case insensitive on linux but is on windows #14019

Closed
Nokel81 opened this issue Jul 1, 2017 · 10 comments
Closed

Require is not case insensitive on linux but is on windows #14019

Nokel81 opened this issue Jul 1, 2017 · 10 comments
Labels
module Issues and PRs related to the module subsystem.

Comments

@Nokel81
Copy link

Nokel81 commented Jul 1, 2017

Version: 6.10.4
Platform: Windows 10 64

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.

@cjihrig
Copy link
Contributor

cjihrig commented Jul 1, 2017

This is related to the underlying file system, not Node itself.

@TimothyGu
Copy link
Member

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 mscdex added the module Issues and PRs related to the module subsystem. label Jul 1, 2017
@mscdex
Copy link
Contributor

mscdex commented Jul 1, 2017

Yep, this is working as intended.

@Nokel81
Copy link
Author

Nokel81 commented 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
Copy link
Contributor

ORESoftware commented 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
Copy link
Author

Nokel81 commented Jul 1, 2017

Sure, I do try to do that. No only an access when the case insensitivity comes into play

@TimothyGu
Copy link
Member

only an access when the case insensitivity comes into play

So… every file access for every file on Windows and macOS? :D

@ORESoftware
Copy link
Contributor

ORESoftware commented 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
Copy link
Member

Answered, closing.

@tniessen
Copy link
Member

tniessen commented Jul 1, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem.
Projects
None yet
Development

No branches or pull requests

7 participants