特定的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
EXPERTE
gefragt vor 6 Monaten36 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen