PS D:\> echo "$([Environment]::OSVersion.VersionString) $(('x86', 'x64')[[Environment]::Is64BitOperatingSystem])"
Microsoft Windows NT 10.0.22631.0 x64
Subsystem
No response
What steps will reproduce the bug?
suppose we have a simple script fake-module.js under C:\Users\dli>:
console.log("fake-module loaded:",{ __filename: __filename, __dirname: __dirname });
Version
v22.1.0.
Platform
Subsystem
No response
What steps will reproduce the bug?
suppose we have a simple script fake-module.js under C:\Users\dli>:
console.log("fake-module loaded:",{ __filename: __filename, __dirname: __dirname });
` Microsoft Windows [版本 10.0.22631.3880]
C:\Users\dli>dir | findstr fake 2024/07/31 12:37 95 fake-module.js C:\Users\dli>
----------------【noctice the disk name is UPPER-case C:】---------
C:\Users\dli>node Welcome to Node.js v22.1.0. Type ".help" for more information.
/
var mod0 = require("./fake-module"); var mod1 = require("C:\Users\dli\fake-module.js"); var mod2 = require("c:\Users\dli\fake-module.js"); /
-----------【noctice the disk name is LOWER-case c:】---------
BUT if some scripts USE cd "c:\Users\dli", such as:
cd "c:\Users\dli" c:\Users\dli>
Welcome to Node.js v22.1.0. Type ".help" for more information.
/
var mod0 = require("./fake-module"); var mod1 = require("C:\Users\dli\fake-module.js"); var mod2 = require("c:\Users\dli\fake-module.js"); /
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
I think when require IF os.platform() is windows: for disk-name, it should case-insensitive.
What do you see instead?
duplicate modules
Additional information
No response