how-to-npm
how-to-npm copied to clipboard
Incorrectly reports wrong folder on windows due to case sensitivity
On Windows cd
with a fully qualified name will list the Current Working Directory with the correct case for the folders (regardless of how the case was typed). However, the drive letter receives the case as typed.
This may cause a false failure of a mismatched path compared to the cwd file checked in the lesson
Uh oh! It looks like you are in the wrong folder.
To reproduce the issue:
- Complete lessons up to the point where
C:\Users\_UserName_\.config\how-to-npm\cwd
file is created - If you are already in the working folder then
cd
to any other folder. -
cd
back to the working folder (the one containing.npmrc
) using a fully qualified path, but this time change the case of the drive letter (the case of the rest of the path does not matter) - run
how-to-npm verify
Folders cannot be checked case-insensitive on other platforms, but the issue here seems to be limited to just the driver letter on Windows. Perhaps checking for a Windows style drive letter and handling in a special case?
To help with this problem I created a package same-path
, and published thanks to this very tutorial.
More testing required, but initial manual tests work fine on Ubuntu and Windows, plus it resolves relative paths.