-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CLI not working on Windows #984
Comments
In the Windows command line, you can change your drive letter casing by switching to a different drive and changing directories on the C: drive. (Assuming you have a D: drive, the following commands will work):
|
Swapping @sindresorhus @jamestalmage @sotojuan @jfmengels Would a simple |
@vdemedes the suggestion is to use |
@novemberborn I meant to lowercase both variables: |
Although yes, path.relative(localCLI, __filename) !== '' |
Related Node.js issue: nodejs/node#6624 |
The CLI is not working for me on Windows, and the issue seems to be with this code:
ava/cli.js
Lines 11 to 15 in f9fe8f2
The problem is with the use of
!==
to comparelocalCLI
and__filename
. In my case, the two variables hold the following values:localCLI: c:\workspace\...\node_modules\ava\cli.js
__filename: C:\workspace\...\node_modules\ava\cli.js
As you can see, the drive letter
c:
is lowercase inlocalCLI
and uppercase in__filename
, thus failing the!==
check.Using
!==
to compare paths doesn't seem to be a particularly good idea since there are numerous different ways the exact same path can be encoded. Not sure what the best practice is for comparing paths in node.js is. Perhapspath.relative()
could be used?The text was updated successfully, but these errors were encountered: