-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
const stringWidth = require('string-width'); #27370
Comments
I couldn't reproduce this issue. Perhaps if you post your |
Hi @AdamBCo unfortunately we cannot replicate this behavior with the provided information. Can you provide a reproducible example using cypress-test-tiny? |
Same identical issue on Ubuntu 22.04 Node - v16.18.1
I tried cypress Thanks :) |
Many thanks for the snippet from your
When I removed all storybook entries there was no issue installing Cypress. You may like to try downgrading to Storybook 7.0. When I did this by changing This will need some more investigation. CommonJS and ESM modules can normally coexist. Perhaps this issue should be reported to storybook as an upgrade issue to Storybook 7.1. released on July 18, 2023? |
Please let us know if you are also using Storybook. |
I did some more investigation. When I execute the following, based on your npm install yarn@latest -g
yarn cache clean
yarn install
yarn add cypress -D there is a warning output:
Would you like to try updating to Yarn Modern? This will be Yarn yarn set version berry
yarn install
yarn add cypress -D Edit: I noticed that storybook is already using Yarn Modern. |
Thanks to @fabio-d-m we have a reproducible example 👍🏻
The workaround listed there is to update to Yarn Modern. So, pending feedback about whether upgrading from Yarn Classic to Yarn Modern resolved the issue, then this issue could be closed as far as Cypress is concerned. Hopefully @AdamBCo will also be able to respond soon. |
Another user with a similar issue installing Cypress on topic of Storybook reported in a Discord topic that they successfully followed advice from storybookjs/storybook#22431 (comment) to resolve their issue. The recommendation says basically: add "resolutions": {
"jackspeak": "2.1.1"
} to Alternatively avoid using Yarn Classic. |
@MikeMcC399 perfect! Thanks a lot for your help :) |
You're very welcome. It was quite a difficult issue due to the root cause not being Cypress itself. Can you confirm that the suggestion worked for you? If yes, then I suggest to close this issue unless we hear from the original poster @AdamBCo that there is still something outstanding. |
@MikeMcC399 Ran into the same issue and adding the package resolution fixed things for me 👍 |
@MikeMcC399 Worked for me as well, thanks a lot! |
Going to close this as resolved. |
Also updated yarn to version 3 to avoid an issue where both storybook and cypress depend on the same node module (string-width) but different versions. See: https://github.com/cypress-io/cypress/issues/27370\#issuecomment-1649715561
yarn set version classic Previously I had switched to yarn version 3 to get around a collision in a dependency between storybook and cypress. Instead I am now going with a solution to set a resolution entry in package.json: https://github.com/cypress-io/cypress/issues/27370\#issuecomment-1652953961
because there is a conflict between Cypress and storybook cypress-io/cypress#27370 (comment)
Thanks @MikeMcC399 |
Thank you @MikeMcC399 |
Current behavior
Every time I run yarn add "cypress", I get the following error:
Debug logs
No response
Cypress Version
Latest
Node version
v18.16.0
Package Manager
yarn
Package Manager Version
1.22.19
Operating system
Mac
Operating System Version
13.2.1 (22D68)
Other
No response
The text was updated successfully, but these errors were encountered: