Elastic Beanstalk EBS NPM Bower 安装失败



我的 EBS 部署出现问题。每次尝试部署生成时获取此输出。

应用程序部署在 2018-07-02T02:46:14Z 失败,退出状态为 1 和错误:.ebextensions/bower.config 中的命令npm_install_bower失败。

npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR! at SecurePair.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 4.14.47-56.37.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "bower"
npm ERR! cwd /opt/elasticbeanstalk/eb_infra
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /opt/elasticbeanstalk/eb_infra/npm-debug.log
npm ERR! not ok code 0.

bower.config 文件是:

commands:
get_sudo:
command: echo Defaults:root !requiretty >> /etc/sudoers 
npm_install:
command: sudo yum -y --enablerepo=epel install nodejs npm
npm_install_bower:
command: sudo npm install -g bower
container_commands:
01_bower_install:
command: "export PATH=$PATH; $NODE_HOME/bin/node ./node_modules/bowe/bin/bower -V install --allow-root -F > /tmp/01_bower_install.log"

尝试了它01_bower_install没有部分,但结果相同。部署失败。直到 2 天前在实例上工作正常,现在显示:

禁止 您无权访问此服务器上的/。

..在网址上。

非常感谢帮助!

我今天花了几个小时在同一个问题上,npm 不会安装 bower,也不会运行。最终让它工作如下:

1(从package.json中删除"bower">

2(这是我的EB扩展文件,它设法安装Bower并运行它,使其成为全局命令:

container_commands:
install_bower:
command: "export PATH=$PATH:$NODE_HOME/bin; npm install bower -g; bower install --allow-root"

干杯 Z.

最新更新