特定的package.json导致弹性Beanstalk部署错误

0

【以下的问题经过翻译处理】 Elastic Beanstalk平台是运行在64位Amazon Linux 2/5.8.0上的Node.js 18。部署时出现错误,错误提示信息如下:

2023-04-16 15:36:30    INFO    Environment update is starting.      
2023-04-16 15:36:37    INFO    Deploying new version to instance(s).
2023-04-16 15:37:12    ERROR  ** Instance deployment: 'npm' failed to install dependencies that you defined in 'package.json'.** For details, see 'eb-engine.log'. The deployment failed.
2023-04-16 15:37:12    ERROR   Instance deployment failed. For details, see 'eb-engine.log'.
2023-04-16 15:37:14    ERROR   [Instance: i-0aa2ec405f17059a4] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
2023-04-16 15:37:14    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2023-04-16 15:37:14    ERROR   Unsuccessful command execution on instance id(s) 'i-0aa2ec405f17059a4'. Aborting the operation.
2023-04-16 15:37:14    ERROR   Failed to deploy application.                                                                              
ERROR: ServiceError - Failed to deploy application.

错误提示显示:“npm”无法安装在“package.json”中定义的依赖项。但是,我在本地机器上使用了节点版本为v18.4.0的yarn install成功。package.json如下:

{
  "name": "aws-demo",
  "version": "1.0.0",
  "description": "aws demo to test package.json install ",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "parse-dashboard": "~5.0.x",
    "parse-server": "~6.0.x"
  },
  "engines": {
    "node": ">=16.x"
  }
}
profile picture
专家
已提问 5 个月前32 查看次数
1 回答
0

【以下的回答经过翻译处理】 似乎由于规格不足导致实例失败,因此增加了规格以解决问题。如果我提高了规格后部署,它会成功吗? 请点击链接查看:https://repost.aws/questions/QU5Nef-o8FT5uoDLO1YTho3w/elastic-beanstalk-npm-install-fails-without-error-message https://stackoverflow.com/questions/71589818/why-npm-install-failed-only-in-elasticbeanstalk

profile picture
专家
已回答 5 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则