I have an angular package in a private npm in azure and I need to install it in a docker. I don't know how to get an authentication token to connect to the private npm, I have .npmrc file.
My docker
FROM node:latest AS build
RUN mkdir -p /app
WORKDIR /app
COPY package.json /app
COPY .npmrc .npmrc
RUN npm install https://myprivate-npm/npm/registry/:_authToken=${NPM_TOKEN}
RUN npm install
When I installed it locally, I ran these two commands from VS Code and they did the job
npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false
vsts-npm-auth -config .npmrc