【问题标题】:Issue deploying to elastic beanstalk "50npm.sh failed"部署到弹性 beantalk“50npm.sh 失败”的问题
【发布时间】:2017-07-01 16:10:37
【问题描述】:

我在将某些代码部署到我的一个环境时遇到问题。

Creating application version archive "app-aa68e-170213_103330".
Uploading PAS-API/app-aa68e-170213_103330.zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.                               
INFO: Deploying new version to instance(s).                         
ERROR: Failed to run npm install. Snapshot logs for more details.   
ERROR: [Instance: i-0ee97a5c7bcab8d51] Command failed on instance. Return code: 1 Output: (TRUNCATED)..."/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
    raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-0ee97a5c7bcab8d51'. Aborting the operation.

npm install 在服务器上运行时似乎部署失败。

【问题讨论】:

    标签: node.js amazon-web-services npm amazon-elastic-beanstalk


    【解决方案1】:

    当我检查 package.json 时,似乎有些 deps 被添加为 tarball 而不是版本号,这意味着当它安装和保存时,它看起来像这样:

    "basic-auth": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.4.tgz"
    

    而不是

    "basic-auth": "^1.1.0",
    

    这在 eb 实例上的 npm install 上失败了,现在看来它可以工作了。

    【讨论】:

      【解决方案2】:

      如果之前没问题,并且您没有更改部署设置,您可以重启实例,通常可以解决问题。

      【讨论】:

        猜你喜欢
        • 2016-10-11
        • 2019-06-15
        • 2017-12-18
        • 2019-04-14
        • 1970-01-01
        • 2016-08-28
        • 2020-09-17
        • 2014-07-12
        • 2020-12-16
        相关资源
        最近更新 更多