gluestack-ui: Error: Command failed: yarn config set legacy-peer-deps true
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
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 12
- Comments: 26 (2 by maintainers)
Off point man
“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?
Hi everyone,
@FezVrasta
Here’s a workaround I managed to get working for me. I recently installed Glue for a new project and ran into an error. My setup is:
Yes, I know I’m using
.yarnrcand.npmrctogether, but it was necessary in this case.Deleted the yarn.lock file.
Run the Glue initialisation command:
After this, you’ll be prompted to select a package manager:
No lockfile detected. Please select a package manager to install dependencies:In my case, I selectedyarnfor my local project configuration.Then, you’ll be prompted again:
No lockfile detected. Please select a package manager to install dependencies:This time, choosenpmso that it picks up the CLI configuration and doesn’t conflict with legacy-peer-deps=true.Then, wait for Glue to install.
Once it finishes the entire configuration, remove package-json.lock and run yarn install again.
I hope this workaround helps!
we will look into it, test and then update the cli.
thank you for reporting 😄
Is there any progress? we’re delaying our migration to gluestack-ui v2 since we’re using yarn v4
I can use gluestack-ui version 0.7.13 when add component.
init gluestack-ui lastest version.
yarn dlx gluestack-ui@latest inituse version 0.7.13 to add component
yarn dlx gluestack-ui@0.7.13 add ...It works for me. Hope It helps you.
I just noticed the same happens when I try to add any component.