0
votes

In my application I host a private npm package. When I'm trying to do a build in my Azure environment I get npm ERR! 404 Not Found: @*****. I also got this message locally when I haven't done the npm login command. How do I go about login in or making my credentials available on the Azure environment?

I've added a .npmrc file to my project and in the build during the npmAuthenticate step it says:

Adding authentication to the .npmrc file at /home/vsts/work/1/s/.npmrc

SYSTEMVSSCONNECTION exists true

SYSTEMVSSCONNECTION exists true

SYSTEMVSSCONNECTION exists true

Adding credentials for a local registry [section]Finishing: npmAuthenticate

1

1 Answers

0
votes

I've figured it out. I had to create a token on npmjs.org, add that to the variables in the build. In the build proces I create a .npmrc file with that token and now authentication works.

- script: | echo //registry.npmjs.org/:_authToken=$(NPM_TOKEN) > .npmrc dir /a displayName: 'npm Authentcation'