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
require()
of ES Module node_modules\string-width\index.js
from node_modules\wide-align\align.js
not supported
#21231
Comments
@danielroe, any ideas on how to ensure we can use an older version of |
You can use yarn resolutions. |
I can confirm that adding the following to
|
I have the same error. For me yarn resolutions not working :/ $ yarn
yarn install v1.22.19
[1/4] Resolving packages...
warning Lockfile has incorrect entry for "string-width@^5.1.2". Ignoring it.
warning Lockfile has incorrect entry for "string-width@^5.0.1". Ignoring it.
warning Lockfile has incorrect entry for "string-width@^5.0.0". Ignoring it. When I have $ yarn
yarn install v1.22.19
[1/4] Resolving packages...
warning Resolution field "string-width@4.2.3" is incompatible with requested version "string-width@^5.1.2"
warning Resolution field "string-width@4.2.3" is incompatible with requested version "string-width@^5.0.1"
warning Resolution field "string-width@4.2.3" is incompatible with requested version "string-width@^5.0.0" When I have $ yarn
yarn install v1.22.19
[1/4] Resolving packages...
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^5.1.2"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^5.0.1"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.1.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.1.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.3"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.1.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.3"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.1.0"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.3"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^1.0.2 || 2 || 3 || 4"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.3"
warning Resolution field "string-width@5.0.0" is incompatible with requested version "string-width@^4.2.3" I still have this error and can't start my project 😥 |
Is this an actual issues? Is there a solution to the problems? This applies not only with nuxt, unfortunately. And also nest js, with the nest-modules/mailer library.😥 |
|
+1 for struggling with this error |
+1, still happening, although using the resolution, removing the yarn.lock and node_modules folder, it worked, even though it warned against an incompatibility between requested versions. wide-align, which is used by npmlog, which is used by vite, eventually, forces the use of string-width<5, which from what I understand, was a dependency that yarn failed to comply with, causing the error. from wide-align package.json:
Again, using the resolutions seems to be working, as long as you don't have a breaking dependency with the string-width ^5, it should be fine, but it can be really annoying. Wide-align has been inactive for over 2 years now, I doubt we will have a fix from them anytime soon. I might make a PR later to fix it |
1.Add this code inside package.json:
Worked for me :) |
Still an issue for us |
rm -rf node_modules |
I have clean new install of nuxt.. added testing setup by following installation from docs here. Hit the error right away. tried solution:
but it hits next module... and I don't like the solution I would expect basic setup to work without hacks :/ Reproduced here: https://stackblitz.com/edit/nuxt-examples-g9ej3w?file=package.json Thnks for any further hints 👍 EDIT: but it is in your docs to install it 🤔
|
Any fix yet? This has killed multiple projects of mine when trying to deploy to azure static web apps. Can use locally but deploying is the problem!! |
* Pin to nuxt/image 1.2.0, since 1.3.0 breaks IPX rendering. Most likely due to nuxt/image#1177. * Add an explicit resolution for jackspeak to work around nuxt/nuxt#21231.
* Pin to nuxt/image 1.2.0, since 1.3.0 breaks IPX rendering. Most likely due to nuxt/image#1177. * Add an explicit resolution for jackspeak to work around nuxt/nuxt#21231.
If you're still encountering this, you should be aware that this is a bug in yarn. See https://github.com/search?q=strip-ansi+string-width&type=issues. This comment explains the issue and provides a workaround. |
I also had the same issue with nuxt.js I suggest to change the package manager from yarn to npm. Remove node_modules and yarn-lock then npm install . It worked for me. |
If it helps anyone encountering a similar error, when attempting to reproduce this issue, I was seeing a very odd error in code sandbox. When setting up a nuxt repo from scratch locally, everything worked fine for me (nuxt v3.10.0, @nuxt/image v1.3.0 at time of writing this). |
…pakkene fører til at yarn test krasjer etter oppgradering av deps. Se nuxt/nuxt#21231 Co-authored-by: Thomas Sebastian Rognes <thomas.sebastian.rognes@nav.no>
Updated: — @kyvg/vue3-notification from 2 to latest 3 version — other dependencies — regenerate yarn lockfile (nuxt/nuxt#21231 (comment)) --------- Co-authored-by: agantelin <agantelin@gmail.com>
The solution is to change the yarn version. |
Deleting node_modules and reinstalling worked for me. (Not using nuxt though, but vite). |
After deleting |
In my case instead of yarn install override with pnpm install on vercel's deployment made it work. |
I deleted |
I came to confirm here. The below steps can resolve the issue. Add this to
And then run these commands.
Problem solved. 💕 |
How many of the people recommending the deletion of yarn.lock actually work with production application? 🤣 The lock file is there for a reason. Deleting it is an insanity. |
@danielroe The root issue is fixed in current version of Yarn. Perhaps it'll be helpful for folks if the first comment in this thread directs them to the Yarn update instructions here: https://yarnpkg.com/getting-started/install#updating-yarn
While the |
Still facing this issue :\ |
SolutionI had the same issue on docker and came across this solution: In my case seems the yarn.lock contained some metadata relative to my locale environment and wont be used on docker environment. |
@navidshad This is not a solution, that is terrible advice. |
To be clear, this is a yarn bug with a workaround. And the bug has been fixed in a newer version of yarn. See #21231 (comment) |
Environment
Stackblitz environment and local
Reproduction
https://stackblitz.com/edit/github-e7ro7z?file=README.md
Describe the bug
Nuxt can't seem to work due to a dependency.
Now I refresh the lock-file multiple times. Take the Stackblitz - I refresh the lockfile there, and it works, but then I copy that lockfile locally and the issue persists there, while I refresh locally (and small chances it doesn't help) and copy to Stackblitz, then the container fails.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: