AWS弹性Beanstalk部署失败,因为存在NPM警告。

3
我的弹性Beanstalk部署日志显示失败。
2021/03/23 14:42:05.458565 [ERROR] An error occurred during execution of command [config-deploy] - [Use NPM to install dependencies]. Stop running the command. Error: Command /bin/sh -c npm --production install failed with error exit status 1. Stderr:npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797 )
npm WARN deprecated is-hex@1.1.3: Development of this module has been stopped.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated request@2.16.6: request has been deprecated, see https://github.com/request/request/issues/3142 
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797 )
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hawk@0.10.2: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated hoek@0.7.6: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@0.1.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@0.3.8: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@0.1.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated json3@3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated node-uuid@1.4.1: Use uuid module instead

这不应该导致平台部署失败。

是否有一种方法可以覆盖ELB的npm install命令,以添加--logLevel=error标志。

即使可以通过某种方式忽略警告,但仍然感觉ELB存在错误。


你能分享一下你的Beanstalk应用程序代码是如何设置的更多细节吗? - Kunal Nagpal
“Stderr:npm WARN…”这条信息是误导性的。在我的情况下,部署失败并不是因为警告,而是由于某些包的错误配置,在我的Mac上安装了这些包,但在AWS的Linux上没有安装成功。” - Shahar Hajdu
1个回答

3

最终使用了一个解决方法,通过添加一个 .npmrc 文件并加入以下行:--logLevel=error


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接