Skip to content

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

Closed

Description

@Nokel81

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.

Activity

  1. cjihrig commented on Jul 1, 2017

    @cjihrig
    Contributor

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

  2. TimothyGu commented on Jul 1, 2017

    @TimothyGu
    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.

  3. added
    moduleIssues and PRs related to the module subsystem.
    on Jul 1, 2017
  4. mscdex commented on Jul 1, 2017

    @mscdex
    Contributor

    Yep, this is working as intended.

  5. Nokel81 commented on Jul 1, 2017

    @Nokel81
    Author

    Okay, would there be anyway for this to log some sort of warning for file systems that allow this sort of insensitivity?

  6. ORESoftware commented on Jul 1, 2017

    @ORESoftware
    Contributor

    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? :)

  7. Nokel81 commented on Jul 1, 2017

    @Nokel81
    Author

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

  8. TimothyGu commented on Jul 1, 2017

    @TimothyGu
    Member

    only an access when the case insensitivity comes into play

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

  9. ORESoftware commented on Jul 1, 2017

    @ORESoftware
    Contributor

    @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 :)

  10. bnoordhuis commented on Jul 1, 2017

    @bnoordhuis
    Member

    Answered, closing.

  11. tniessen commented on Jul 1, 2017

    @tniessen
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions