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

Can't update HD1 dependencies #4113

Closed
davidmehren opened this issue May 28, 2023 · 3 comments
Closed

Can't update HD1 dependencies #4113

davidmehren opened this issue May 28, 2023 · 3 comments
Labels
type: discussion Something needs to be planned/discussed

Comments

@davidmehren
Copy link
Member

davidmehren commented May 28, 2023

Description

Yarn 1 seemingly breaks when packages rename their dependencies.

Via rimraf, we depend on @isaacs/cliui. This package depends on two versions of string-width simultaneously, see its package.json:

    "string-width": "^5.1.2",
    "string-width-cjs": "npm:string-width@^4.2.0",

string-width 5 is ESM-only, so version 4 is renamed to string-width-cjs. Yarn 1 seems to only support this properly when no yarn.lock is present. On every install attempt after the lockfile is created, Yarn 1 incorrectly hoists the more recent (ESM-only) version to the root of node_modules, which breaks imports from Common JS modules.

Yarn also complains about packages wanting to write to the same directory.

Other people experiencing this issue:

Steps to reproduce

Expected behavior

Install succeeds.

Logs

No response

Config

No response

Your Setup

  • Host OS: Fedora 38
  • NodeJS version: v16.20.0, Yarn 1.22.19
@davidmehren davidmehren added the type: discussion Something needs to be planned/discussed label May 28, 2023
@davidmehren
Copy link
Member Author

Yarn fixed this in version 2 and up: yarnpkg/yarn#4812 (comment)

We can now

  • stop updating dependencies that cause the bug
  • pin dependency versions using resolutions, violating dependency constraints of some packages
  • update to Yarn 3

I'd favor option three, but wonder how much this will break people's setup?

@mrdrogdrog
Copy link
Member

Option 3 still sounds better then having out of date packages.

@davidmehren davidmehren mentioned this issue May 28, 2023
4 tasks
@ErikMichelson
Copy link
Member

The switch to yarn berry has been merged and will be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: discussion Something needs to be planned/discussed
Projects
None yet
Development

No branches or pull requests

3 participants