SELF_SIGNED_CERT_IN_CHAIN error on Elastic Beanstalk for NodeJS

前端 未结 5 918
终归单人心
终归单人心 2021-01-15 14:05

I\'m well aware of the root of this issue, as npm wrote on their blog: http://blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more

Th

相关标签:
5条回答
  • 2021-01-15 14:39

    I struggled with this as well. Fix: https://gist.github.com/anonymous/fb32a4b053fe121b0b03. When applied in container_commands npm install has already run.

    0 讨论(0)
  • 2021-01-15 14:49

    Was having the same issue today. I fixed it by setting my global npmrc file, as follows:

    02_no-cert:
      command: "rm -rf /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc && mkdir /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc && echo 'ca = ' > /opt/elasticbeanstalk/node-install/node-v0.10.21-linux-x64/etc/npmrc"
      ignoreErrors: true
    
    0 讨论(0)
  • 2021-01-15 14:52

    So I figured out a way to make it work:

    Put this in .ebextensions:

    commands:
      01_enable_rootaccess:
        command: echo Defaults:root \!requiretty >> /etc/sudoers
      02_no-cert:
        command: sudo /opt/elasticbeanstalk/node-install/node-v0.10.10-linux-x64/bin/npm config set ca ""
    

    Worked like a charm in my case.

    0 讨论(0)
  • 2021-01-15 14:52

    It did not work for me either.

    What I did find: at the time that the "commands" block is run, the node-install folder is empty. I assume this is because the commands run before node + npm is fully deployed to the bare instance.

    I will try and test this assumption later today, and provide further feedback.

    0 讨论(0)
  • 2021-01-15 15:00

    Sadly, didn't work for me. Amazon gave me a different version, that has not worked either:

    commands: 01-command: command: '$(find /opt/elasticbeanstalk/node-install/*/bin | grep "npm$" | head -n1) config set ca ""'

    0 讨论(0)
提交回复
热议问题