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.