Npm login leads to npm ERR! cb() on GitLab CI/CD

A GitLab CI/CD pipeline has been created to install a private npm package. The process fails at the npm login step.

The .gitlab-ci.yml file has the following script:

image: node:lts

stages:
- setup

install_package:
stage: setup
script:
- npm config set "myProject:registry" "https://gitlab.com/api/v4/packages/npm/"
- npm config set "//gitlab.com/api/v4/packages/npm/:_authToken" "${ACCESS_TOKEN}"
- npm login --registry https://gitlab.com/api/v4/packages/npm/
- npm install -g  myPrivatePackage

CI/CD fails at the npm login step with the following message:

Username: npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-05T15_46_33_042Z-debug.log

Hi Andrew, so have you resolved it? I have a similar issue.
NPM doesn’t seem to consume NPM_TOKEN anymore.
So basically I don’t know how to pass it the damned token.

i am facing same issue while using npx create-react-app
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2021-10-09T04_03_03_368Z-debug.log

how to resolve this

Hello,
You know what ? I have got the same issue that prevents me from installing Angular (even without logging in to npm, but the error message is the same), I try executing the project with “npm test” instead of “ng serve --o”.
That problem is present for some weeks.
Can we understand that npm is not maintained any more, and that we must reinvent everything from scratch ?
After having put a few years of Angular on my resume, I am afraid of having to add “sorry I can no more develop on this”, which I am afraid gives a moderately serious impression.
Really no serious answer ?