Since today, I can’t publish my npm package from Gitlab CI to gitlab npm registry (It worked well few days/weeks ago).
The npm publish command throw the following error :
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`
Account on gitlab.com (I’m maintainer of the repo)
Gitlab Version : GitLab Enterprise Edition 13.8.0-pre 413d723b2cc
I already checked the npm registry documentation / tutorials and nothing had change on it since I had written my gitlab ci configuration.
I also try to remove the current version of the package and relaunch the build on a commit which worked in the past, without success.
I would be very grateful if you could help me fix my problem or identify a potential new bug.
We are also facing the same issue (npm ERR! need auth You need to authorize this machine using npm adduser ) that after upgrading npm version from v6 to v7 but there is no change in the gitlab runner. I have tried with all possible suggested options as above and from other blogs, but still no luck for us to resolve the issue. Following options have been tried.
Change of node image from latest to 14-buster
Regenerated and added personal access token.
in CI script for generating the .npmrc file, _auth pointed instead of _authToken
Highest npm version 7.21.0 and nodejs 16.x
Downgrade to older version of nodejes 10.x which doesn’t support by the nodejs.
Tried with .npmrc file and “npm configure set xxx” through ci script.
Thanks for your suggestions in advance and appreciate your support.