drone-plugins / drone-npm

Drone plugin for publishing packages to NPM
http://plugins.drone.io/drone-plugins/drone-npm
Apache License 2.0
20 stars 18 forks source link

Failed authentication on using GlobalRegistry with a token #51

Closed tlee21 closed 4 years ago

tlee21 commented 4 years ago

After #50 was merged, I'm seeing an error using the GlobalRegistry with a token. The root cause appears to be the new requirement of the registry url to have a '/' at the end.

Workaround

A workaround for now is to manually specify the registry url to:

https://registry.npmjs.org/

Proposed fix

Please see #52

Error Log

time="2019-10-29T04:18:40Z" level=info msg="Token credentials being used"
--
2 | time="2019-10-29T04:18:40Z" level=info msg="Writing npmrc" path=/root/.npmrc
3 | + npm --version
4 | 6.9.0
5 | + npm config set always-auth true
6 | + npm whoami
7 | npm ERR! code ENEEDAUTH
8 | npm ERR! need auth This command requires you to be logged in.
9 | npm ERR! need auth You need to authorize this machine using `npm adduser`
10 |  
11 | npm ERR! A complete log of this run can be found in:
12 | npm ERR! /root/.npm/_logs/2019-10-29T04_18_41_033Z-debug.log
13 | time="2019-10-29T04:18:41Z" level=fatal msg="Could not authenticate"
lafriks commented 4 years ago

Fixed in #52