Last active
October 18, 2019 00:10
-
-
Save mnaoumov/debe6db18a0f3a568d1dc4d23df4b499 to your computer and use it in GitHub Desktop.
Windows case-insensitive file names = nightmares with Node.JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@node "%~dp0\script.js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir C:\CaseSensitive -Force | Out-Null | |
copy * C:\CaseSensitive -Force | Out-Null | |
# works fine | |
Write-Host "Running from c:\CaseSensitive" | |
cd c:\CaseSensitive | |
.\build.cmd | |
# fails | |
Write-Host "Running from c:\caseSENSitive" | |
cd c:\caseSENSitive | |
.\build.cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myModulePath1 = __dirname + '/myModule'; | |
const myModule1 = require(myModulePath1) | |
myModule1.myFunction = () => {}; | |
const myModulePath2 = process.cwd() + '/myModule'; | |
const myModule2 = require(myModulePath2); | |
myModule2.myFunction(); // Fails here | |
console.log('Works fine'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment