Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-16846

NPM Error: EACCES: permission denied

XMLWordPrintable

      When running NPM on Alpine-based Docker images as root user, the following error message is returned with a stack trace:

      #!
      
      Error: EACCES: permission denied
      
      

      Am I affected by this?

      1. To see if you are running as the root user, you can run: $ whoami
      2. To see if you are running an Alpine-based Docker image, you can run: $ cat /etc/os-release

      Workaround

      Please ensure you have cleared your node caches in Pipelines when trying these solutions.

      1. You can configure your pipeline to run as another user as this issue only occurs when you are running as the 'root' user.
      2. If you need to run as the root user, you will need to use a non-Alpine-based Docker image.
        • For example, if you are using the node:8 Docker image, then instead you could use node:8-jessie.

      Why is this happening now?

      On July 31st 2018, the Pipelines team upgraded AWS instance types to keep up with our scaling and performance requirements. However, this exposed a downstream bug which affects the current versions of Alpine. As a result of this bug, certain NPM builds have started failing. Note: We will update this ticket as we get more information.

      We have added our own workaround where possible, which have covered the majority of NPM build failures, however this particular issue unfortunate requires manual intervention.

              phodder Philip Hodder
              phodder Philip Hodder
              Votes:
              7 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: