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

Error: Command failed: yarn config set legacy-peer-deps true #2567

Open
1 of 6 tasks
FezVrasta opened this issue Nov 6, 2024 · 22 comments
Open
1 of 6 tasks

Error: Command failed: yarn config set legacy-peer-deps true #2567

FezVrasta opened this issue Nov 6, 2024 · 22 comments
Assignees
Labels
bug Something isn't working

Comments

@FezVrasta
Copy link
Contributor

Description

Trying to initialize a new project with gluestack-ui and Yarn 4.x errors out

CodeSandbox/Snack link

N/A

Steps to reproduce

yarn init
yarn set version 4.5.1
yarn dlx gluestack-ui@latest init

gluestack-ui Version

latest

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

No response

@YDaskaloff
Copy link

would be useful if you added the actual output.

@FezVrasta
Copy link
Contributor Author

It's in the title, Error: Command failed: yarn config set legacy-peer-deps true

@FezVrasta
Copy link
Contributor Author

I just noticed the same happens when I try to add any component.

CleanShot 2024-11-06 at 4  25 45@2x

@JavanPoirier
Copy link

+1

2 similar comments
@JMRMEDEV
Copy link

+1

@keepersmith
Copy link

+1

@keepersmith
Copy link

"npx gluestack-ui@latest init" just flat out does not work with yarn 2+ because of this.
"classic" yarn is super old by now.
Is this going to be fixed?

@Kwonkunkun
Copy link

+1

@rajat693
Copy link
Collaborator

rajat693 commented Dec 9, 2024

Thanks for reporting this. Currently, we provide full support for the Yarn Classic stable version (1.x) and will look into your suggestion.

@myckhel
Copy link

myckhel commented Dec 10, 2024

Please help us.

@myckhel
Copy link

myckhel commented Dec 10, 2024

Please help us.

You're a software developer, use your problem solving skills... All I did was init a project with npm, and copy over all the components and deps. If you can't sort that out, you can pay the Gluestack team to help you. Them offering this fantastic library for free is help enough.

Off point man

@bdotsamir
Copy link

Here's what I think is happening:

In modern versions of yarn, when you install a package, it installs its peer dependencies by default. This didn't always used to happen. It used to be that it wouldn't install peer deps by default. This is what setting this flag legacy-peer-deps does- it disables the automatic installation of peer dependencies. Here's where I'm getting this information from: https://stackoverflow.com/a/66620869/8916706

If somebody were to write up a quick PR, figuring out what the modern-day yarn equivalent is would be a great start

@b3ni
Copy link

b3ni commented Jan 23, 2025

+1

1 similar comment
@okikiola-leaders
Copy link

+1

@andreiCrisan55
Copy link

andreiCrisan55 commented Feb 10, 2025

+1

@akash3gtm
Copy link
Collaborator

We're waiting for yarn version latest version to be stable.
Yarn's solution as mentioned in docs is to update the packages itself as to have better peer dependencies.

Since, we use other libraries like native-wind we can't actually do that.

Hence no solution at the moment.

If you guys have any suggestion in mind, we are always happy to get public contributions.

@myckhel
Copy link

myckhel commented Feb 14, 2025

Workaround ive been using is to run yarn install after the error.

@akash3gtm
Copy link
Collaborator

and there is no issue with anything when you don't use the --legacy-peer-deps?

@myckhel
Copy link

myckhel commented Feb 14, 2025

Yes sure.

@akash3gtm
Copy link
Collaborator

we will look into it, test and then update the cli.

thank you for reporting 😄

@alparbartok
Copy link

+1

@akash3gtm
Copy link
Collaborator

This will take some time, we thank you for the patience.
for the time being you can use the hack to just run yarn again, and delete the .npmrc file where we do set the legacy-peer-deps=true .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests