CodeBuild最新节点版本与EC2不匹配
是否有人遇到过这个问题,即CodeBuild的节点14的最新版本为14.19。 2 ,但EC2的最新支持版本的节点14为14.19。 1 。
由于CodeBuild不支持指定次要版本,因此我坚持使用14.19.2构建,然后在构建完成时无法部署,因为EC2中的节点版本不匹配。
来自CodeBuild的日志:
> [Container] 2022/05/21 14:21:15 Running command echo "Installing
> Node.js version 14 ..." Installing Node.js version 14 ...
>
> [Container] 2022/05/21 14:21:15 Running command n $NODE_14_VERSION
> copying : node/14.19.2 installed : v14.19.2 (with npm 6.14.17)
从部署到EC2的日志:
[1/5] Validating package.json...
2022-05-21T06:53:18.834-07:00 error [email protected]: The engine "node" is incompatible with this module. Expected version "14.19.1". Got "14.19.2"
2022-05-21T06:53:18.834-07:00 error Found incompatible module.
Has anyone run into the issue that Codebuild's latest version for node 14 is 14.19.2 but EC2's latest supported version of node 14 is 14.19.1.
Since Codebuild doesn't support specifying minor version, I'm stuck at building with 14.19.2 and then can't deploy when the build finishes because the node version in the EC2 is mismatched.
Logs from Codebuild:
> [Container] 2022/05/21 14:21:15 Running command echo "Installing
> Node.js version 14 ..." Installing Node.js version 14 ...
>
> [Container] 2022/05/21 14:21:15 Running command n $NODE_14_VERSION
> copying : node/14.19.2 installed : v14.19.2 (with npm 6.14.17)
Logs from deploy to EC2:
[1/5] Validating package.json...
2022-05-21T06:53:18.834-07:00 error [email protected]: The engine "node" is incompatible with this module. Expected version "14.19.1". Got "14.19.2"
2022-05-21T06:53:18.834-07:00 error Found incompatible module.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
并不完美,但是我更改了包装。JSON允许两个版本,现在它可以构建和部署。
CodeBuild会支持EC2更高版本仍然很奇怪。
Not perfect, but I changed my package.json to allow both versions and now it builds and deploys.
It's still weird that Codebuild would support a higher version that EC2.
我还没有尝试过,但是也许可以做到这一点。
FYI: https://blog.serverworks.co.jp/specific- nodejs-version-in-codebuild
I haven't tried it yet, but maybe this way it could be done.
FYI: https://blog.serverworks.co.jp/specific-nodejs-version-in-codebuild