【以下的问题经过翻译处理】 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"
}
}