【问题标题】:Elastic Beanstalk EBS NPM Bower install is failingElastic Beanstalk EBS NPM Bower 安装失败
【发布时间】:2018-12-10 13:09:24
【问题描述】:

我的 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 天前在实例上工作正常,现在显示:

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

..在 URL 上。

帮助不胜感激!

【问题讨论】:

    标签: amazon-web-services npm amazon-elastic-beanstalk bower npm-install


    【解决方案1】:

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

    1) 从 package.json 中移除“bower”

    2) 这是我的 ebextension 文件,它通过将其设置为全局命令来安装并运行它:

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

    干杯, Z.

    【讨论】:

    • 附注如果您已经有一段时间没有安装该软件包,那么凉亭人还会有另一个惊喜 - 存储库已更改。您需要将以下行添加到 .bowerrc 以使其工作: "registry": "registry.bower.io"
    猜你喜欢
    • 2017-08-03
    • 2014-11-15
    • 1970-01-01
    • 2017-01-24
    • 1970-01-01
    • 2016-03-11
    • 2018-01-29
    • 2018-03-08
    • 2018-12-28
    相关资源
    最近更新 更多