How to use a private npm registry on Elastic Beanstalk?

前端 未结 6 1013

We have a nodejs project running on Amazon Elastic Beanstalk that uses private modules that we host using nodejitsu\'s private npm registry.

However getting access t

6条回答
  •  伪装坚强ぢ
    2020-12-05 19:00

    So, we managed to get this working by using the npm userconfig file. See the doc page for npmrc for more info.

    When a nodejs application is being deployed to Elastic Beanstalk, the root user runs npm install. So you will need to write the root's npm userconfig file, which is at /tmp/.npmrc.

    So if you add a file called private_npm.config (or whatever name you choose) to your .ebextensions folder with all the information needed, you will be good to go. See Customizing and Configuring AWS Elastic Beanstalk Environments for more info.

    So here is what my file looks like to use nodejitsu private registry.

    .ebextensions/private_npm.config:

    files:
      #this is the npm user config file path
      "/tmp/.npmrc":
        mode: "000777"
        owner: root
        group: root
        content: |
          _auth = 
          always-auth = true
          registry = 
          strict-ssl = true
          email = 
    

提交回复
热议问题