1

I am trying to use npmAuthenticate task in azure pipeline which is running script in custom docker container

container:
  image: android_builder:37878
  endpoint: sc-acr

steps:
- task: npmAuthenticate@0
  inputs:
    workingFile: '.npmrc'
- script: |
    npm i

The azure private registry is in my organisation, but npm install is failing because of auth I haven't found a example of using this task in docker container in documentation, so not sure if this works in this way

1 Answer 1

1

the npm authenticate task is just for task runners. You can use the npm task itself, with your private registry as a custom feed

- task: Npm@1
  inputs:
    command: 'install'
    customRegistry: 'useFeed'
    customFeed: '<YOUR FEED ID>'
Sign up to request clarification or add additional context in comments.

2 Comments

According to this link npm authenticate is the recommended way. I tried the above, npm task failed with the error npm ERR! Maximum call stack size exceeded npm install works if I copy-paste token in my .npmrc file, but its not ideal way as that token should not be committed with repo
are you trying to build in a Dockerfile? If so, you can have a multi-stage build

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.