I want to write a pipeline to publish an Angular library however, I'm getting an error
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://registry.npmjs.org/
npm ERR! need auth You need to authorize this machine using `npm adduser`
In my pipeline I have the following steps:
- task: npmAuthenticate@0
displayName: Authenticate via NPM
inputs:
workingFile: $(WorkDirectory)/middleware-angular/.npmrc
// install and build steps...
- script: |
cd $(WorkDirectory)/middleware-angular
npm publish dist
displayName: 'Publish package'
The .npmrc file is located in the middleware-angular
folder
I don't understand why I need to log in to npm if I have added the npm authenticate task, by the way, it worked with Node version 14 but stopped when I changed it to 16