Azure-pipelines-tasks: Cannot authenticate on npmjs.com to publish a package with NPM task 1.*

Created on 3 Aug 2017  路  5Comments  路  Source: microsoft/azure-pipelines-tasks

Hello,

I'm not sure if this issue should go there as it is more related to the options provided by the NPM service endpoint.

In fact, I tried to publish an existing package to npm.js I was publishing using the 0.* version of the task and an authentication token stored in the .npmrc file on my private build agent.

But with the new version of the task, I cannot neither fill this authentication token in a new NPM service endpoint (supports only Basic Auth or VSTS PAT) nor let the task use my .npmrc file.

I think a third option should be available to create a NPM service endpoint, "npmjs public registry", which would just ask for a connection name and an authentication token. Those would be sufficient to properly generate a .npmrc file at runtime.

Thank you!

Most helpful comment

@asiffermann,
I've fixed this. You will no longer need to use basic auth for registries that aren't VSTS. Task should be available on visualstudio.com very soon.

All 5 comments

@asiffermann ,
When you put the public registry's token into [1], what happened when you clicked "Verify connection"? This option should work for the public registry although the verbiage is confusing and something we will change.
Keith

[1]
image

Hi,

I tried it before (was suspecting the verbiage issue), but it does not work:

image

What I put in the PAT field is just the authentication token from npmjs, which looks like a GUID and is working when used from a .npmrc file.

@asiffermann,
We are going to add a 3rd option for registries that use bearer auth (i.e. npmjs). However, in the meantime might still be able to use basic auth with npmjs and ignore the verify connection button. The build task should appropriately configure the .npmrc to use basic with npmjs. This will work as long as npmjs has basic enabled.
Keith

@asiffermann,
I've fixed this. You will no longer need to use basic auth for registries that aren't VSTS. Task should be available on visualstudio.com very soon.

It seems to be already available on visualstudio.com! Many thanks @keithrob!

Was this page helpful?
0 / 5 - 0 ratings