-
Notifications
You must be signed in to change notification settings - Fork 824
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
Amplify CLI not working with Yarn 4 #13377
Comments
I also am getting this with a yarn berry (modern) project, I haven't added a new lambda function in a while but after performing the add function, I am unable to do the following:
I can get amplify to build if I revert to yarn classic, and then do the amplify operations, and then set yarn back to berry. This is a major issue. |
FWIW As a workaround while we wait to get amplify updated to work with yarn modern. I created my own
It simply checks to see if yarn is being invoked with the deprecated |
I am also encountering this issue on Linux, |
We've got Yarn 4 with Yarn workspaces working on Amplify CLI
The With this small tweak, our Yarn 4 functions can be successfully deployed with I couldn't find anything about this in the documentation, but I happened to stumble upon the setting when adding a new function this week. It looks like the default |
The trick to change the script to |
When I use yarn 4, the CI/CD fails for my TypeScript Lambda: ✖ There was an error initializing your environment. 2024-06-21T01:05:19.595Z [INFO]: 🛑 Packaging lambda function failed with the error Command failed with exit code 1 |
Try this, this worked for me amplify.yml
|
How did you install the Amplify CLI?
curl
If applicable, what version of Node.js are you using?
v18.18.2
Amplify CLI Version
12.7.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
When deploying a Lambda Function in a Project based on Yarn 4, the command
amplify push
crashes as follows:Which is caused most likely through this code in
amplify-cli-core/src/utils/packageManager.ts
:It should be changed to invoke
yarn workspaces focus
Expected behavior
Deploy lambdas correctly using Yarn 4
Reproduction steps
Project Identifier
Session Identifier: 7282a548-35f7-42e4-b29d-19df116b78e0
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: