-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Error message when running cucumber test with npm prefix on Windows #2274
Comments
Hmm... I'll look into this. |
Ok, I don't fully understand the way we are doing this check, but it looks a bit hackish. I found this library https://www.npmjs.com/package/resolve-package-path This might resolve both cases correctly, but do we want to add this package to fix this somewhat rare corner case? |
To be clear this is only a warning, doesn't prevent you running. The detection is from https://www.npmjs.com/package/is-installed-globally and I don't think it's something we should implement/maintain in Cucumber. Since #2089 the handling for the issue that global (and other invalid) installations cause is much better, so arguably we could make this warning more subtle (one line, softer language) or even just remove it. |
@davidjgoss yes I agree its only a warning, and its not affecting behaviour, making this a minor bug. It's more of an annoyance right now, as the QAs running test scripts on Windows in my current company are asking me what they've done wrong to cause that warning message to occur. (the warning does not occur on Mac). Our setup is a bit more complex, but I've simplified it greatly in the example repo I provided. |
If we remove it and there is a crash because cucumber was installed as a global, will the error message be clear? Could it be altered to make it clear in such circumstances? If so I would suggest doing that - remove this warning then alter the error message that arises when trying to import or require a step file when cucumber is installed globally. That said, I have a feeling this might be very difficult to write a test case for. |
FYI I am not proposing we remove anything (as it would still be useful to be notified of a global installation) but rather fix the original intended behaviour. In my sample repo we can see the following: On Mac: On Windows: But The issue appears to be inside the |
The issue is Windows. And I'm saying this as a Windows user. Kidding aside, the most direct fix would need to be in that |
Took the middle ground here - the warning remains but the language is softened and it's only shown in debug mode. The issues that stem from using a global install are much less cryptic than they used to be, so I think this is fine now. |
(I think it would be worth raising an issue on |
👓 What did you see?
There is a bug causing "It looks like you're running Cucumber from a global installation." message to occur when the following conditions occur:
npm
script defined in package.jsonnpm
script using--prefix
.✅ What did you expect to see?
No error message should occur on Windows, if the
--prefix
directory is correct.📦 Which tool/library version are you using?
latest
🔬 How could we reproduce it?
Please see an example of the bug that can be easily replicated here:
https://github.com/arbughiu/cucumber-windows-npm-prefix
The text was updated successfully, but these errors were encountered: