Skip to content

Commit

Permalink
fix(amplify-nodejs-function-runtime-provider): catch yarn 2 error on …
Browse files Browse the repository at this point in the history
…lambda build (#8263)
  • Loading branch information
danielleadams committed Oct 21, 2021
1 parent 40f9cb0 commit 2c80057
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -60,6 +60,8 @@ function runPackageManager(cwd: string, buildType?: BuildType, scriptName?: stri
} catch (error) {
if ((error as any).code === 'ENOENT') {
throw new Error(`Packaging lambda function failed. Could not find ${packageManager} executable in the PATH.`);
} else if (error.stdout?.includes('YN0050: The --production option is deprecated')) {
throw new Error(`Packaging lambda function failed. Yarn 2 is not supported. Use Yarn 1.x and push again.`);
} else {
throw new Error(`Packaging lambda function failed with the error \n${error.message}`);
}
Expand Down

0 comments on commit 2c80057

Please sign in to comment.