We have a private npm registry (library) for our Angular UI because of this we can't run npm install before authenticating the private registry. The registry is in a different Azure organization. When I work on a local machine for the first time, I run this code, (npm install -g vsts-npm-auth --registry https://registry.npmjs.com --always-auth false) and then this code (vsts-npm-auth -config .npmrc), then pop up appear and I need to input my credentials, like username and password after that I can now use npm install to install packages from my private registry.
In azure CI pipe-line there is no user interaction so what I did was, I created a service connection with username(organization username) and password(organization password) and the package URL which I have found in .npmrc file. I then use the service connection in NPM Authenticate Task to authenticate the registry but it throws me an error when npm install run. I have posted the error pic below. Can anyone please help me to authenticate the private registry to install packages. Thanks