Skip to content
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

cypress-ntlm-auth can not resolve cypress (cypress-ntlm-auth requires Cypress to be installed) #240

Closed
SarunasMaro opened this issue Sep 7, 2023 · 5 comments

Comments

@SarunasMaro
Copy link

Hello,

I have "cypress": "12.9.0" and "cypress-ntlm-auth": "^4.1.2" versions installed on my machine and when I run commands yarn run cypress-ntlm run or yarn run cypress-ntlm open, I get the following error: "cypress-ntlm-auth requires Cypress to be installed". Looking at the source code in src/startup/cypress.loader.js and src/startup/startup.ts it seems that cypress-ntlm-auth can not resolve cypress. Our project has enjoyed Cypress in combination with cypress-ntlm-auth in the past a lot. Could you please help?

Machine: Macbook Pro M1 chip
OS: MacOS Ventura 13.5.1
Package manager: Yarn
Package installation strategy: Yarn Plug'n'Play

@bjowes
Copy link
Owner

bjowes commented Sep 7, 2023 via email

@SarunasMaro
Copy link
Author

I can confirm that Cypress and cypress-ntlm-auth are both locally installed devDependencies. The testing module is the only place in the project that they are installed in.

@bjowes
Copy link
Owner

bjowes commented Sep 10, 2023

After a bit of read-up it seems to me that the Plug'n'Play strategy changes quite a bit how installed packages are stored. Most likely this results in that NodeJS cannot detect that cypress is actually installed.

First, try avoiding the Plug'n'Play strategy, at least for the cypress part of your project.

If you really want to make that work too, try setting a path to where cypress can be found as a second argument to the require.resolve('cypress') in startup/cypress.loader.js in the plugin. Likely some similar workaround would then be needed with the resolve('cypress) call in the same file. Once you get that working, let me know what you did and I will consider adding some additional environment variable to pass additional resolve paths.

@SarunasMaro
Copy link
Author

Well, I can't access these files as they are zipped. Could you maybe add that line of code in the next release?

@bjowes
Copy link
Owner

bjowes commented Sep 14, 2023

Not sure what you mean, if the files you need to access are zipped, just unzip them.
The problem here is that I don't know what path to add, this would need some trying out and may even be project specific. If you provide a repo here I can reproduce your issue I can help in more detail, but with the limited info I have there is not much I can do.
As stated, the simple solution is to avoid using the Plug'n'Play strategy in yarn.

@bjowes bjowes closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants