首页 > 解决方案 > AWS“放大推送”失败,“命令失败,退出代码为 1:yarn --production”

问题描述

我正在按照教程在我的 AWS amplify node.js proejct 中添加一个 lambda 函数,当我

amplify push

它以这个错误结束:

Current Environment: dev

| Category | Resource name | Operation | Provider plugin   |
| -------- | ------------- | --------- | ----------------- |
| Function | mylambda      | Create    | awscloudformation |
| Api      | myapi         | Create    | awscloudformation |
✖ An error occurred when pushing the resources to the cloud

Packaging lambda function failed with the error 
Command failed with exit code 1: yarn --production
An error occurred during the push operation: Packaging lambda function failed with the error 
Command failed with exit code 1: yarn --production

我尝试重新创建放大项目,但最终出现相同的错误。

标签: amazon-web-services

解决方案


我遇到了同样的错误。就我而言,我在我的 macOS 上安装了 Hadoop 纱线。yarn我终端上的命令正在调用 Hadoop 纱线。

我删除(重命名)/usr/local/Cellar/hadoop目录以删除 Hadoop。之后,amplify push成功运行。


推荐阅读