-
Notifications
You must be signed in to change notification settings - Fork 825
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 Push Failed after amplify add function #7883
Comments
Hi @dan0nator, what version of yarn are using? --production should work with yarn classic (1.x). https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-production-true-false |
yarn version 2.4.1 - i have not updated the yarn version, but i did update the amplify API |
I'm having a similar issue. But my problem with In version 5.2.0 and below, I didn't have the issue above, but each lambda function/layer has devDependencies inside their node_modules. Can/do we have something like SAM's building custom runtime in Amplify? I checked the file
This might solve the build and the devDependencies inside node_modules issues but won't solve the yarn v2 issue. |
For anyone else having this error when using yarn v2 for their project:
We fixed this with a simple workaround:
|
Currently migrating a project to Yarn 2, and also running into this issue. @adam-nygate thanks for the workaround. Hopefully, the fix isn't far away. |
@dan0nator Yarn 2 isn't supported by Amplify CLI yet, so the workaround is the only way to do this right now. In the future, the CLI will have to detect usage of Yarn >= 2 when building the lambda to use the new |
I've used npm to install modeules into my amplify layer function and I'm getting this error, I've never used yarn before with this project, why would I be getting this error? Also any idea how I can fix it? |
Hitting this same exact issue @gambithunt , why is this closed? |
On ubuntu 20.04, running sudo apt remove cmdtest fixed it! |
THANK YOU! This fixed it for me as well |
worked for me too after running sudo apt remove cmdtest |
I got it to work by temporarily switching to the old yarn with |
This error has returned. It started 2 days ago using the latest cli when doing "amplify push" after "amplify add function" YN0050: The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead |
navigating to the directory that holds the function and running "npm install" installed the requisite modules. Running "amplify configure" after that first step worked. |
This is still a problem (for me). I have almost 30 functions, not scalable to use the workaround suggested 3 years ago. Is there any other way to do this? And is there any reason why this hasn't been fixed yet? we have yarn v3 now. Thanks |
Before opening, please confirm:
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
14.15.5
Amplify CLI Version
5.2.1
What operating system are you using?
Windows 10 Pro
Amplify Categories
function
Amplify Commands
push
Describe the bug
When pushing to amplify I get the following error:
Packaging lambda function failed with the error
Command failed with exit code 1: yarn.cmd --production
➤ YN0050: The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead
An error occurred during the push operation: Packaging lambda function failed with the error
Command failed with exit code 1: yarn.cmd --production
➤ YN0050: The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead
if I remove the function with "amplify remove function" it will push without issue.
I can pull without issue as well.
Expected behavior
It should push without error.
Reproduction steps
amplify add function
complete steps to add function (vanilla) nothing but defaults.
amplify push
GraphQL schema(s)
# Put schemas below this line
Log output
Additional information
No response
The text was updated successfully, but these errors were encountered: