Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm warn Name must be lowercase (GitLab CI) #8166

Closed
2 tasks done
dbfurrer opened this issue Mar 14, 2025 · 2 comments
Closed
2 tasks done

[BUG] npm warn Name must be lowercase (GitLab CI) #8166

dbfurrer opened this issue Mar 14, 2025 · 2 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@dbfurrer
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

+++ npm config get registry
+++ sed -e 's/^https://'
++ printf %s:_authToken=%s //binarios.intranet.bb.com.br/artifactory/api/npm/npm/ [MASKED]
++ echo [MASKED]
++ npm login --registry=https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/ --auth-type legacy --always-auth
npm notice Log in on https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/
Username: npm warn Name must be lowercase
Username: ([MASKED])
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-03-14T14_06_28_918Z-debug-0.log

Despite username being in lowercase

Expected Behavior

Expected to log in normally since it was working a couple of months ago

Steps To Reproduce

  1. In GitLab CI
  2. With this config:

yaml-language-server: $schema=https://gitlab.com/gitlab-org/gitlab/-/raw/v15.0.5-ee/app/assets/javascripts/editor/schema/ci.json

default:
image: node:20

Cache modules using lock file

cache:
key:
files:
- package-lock.json
paths:
- .npm/

Cancel previous runs of the same pipeline on the same branch.

interruptible: true
before_script:
- |-
set -eux

  npm config set strict-ssl false

  _base_url='https://binarios.intranet.bb.com.br/artifactory'
  _npm_config="$(npm config get userconfig)"

  declare -A config=(
      ["registry"]="api/npm/npm/"
      ["appd_cdn_base_url"]="generic-appdynamics-node-remote/"
      ["canvas_binary_host_mirror"]="generic-node-canvas-remote"
      ["dist-url"]="generic-nodejsdist-remote"
      ["disturl"]="generic-nodejsdist-remote"
      ["phantomjs_cdnurl"]="generic-bb-binarios-ptn-local/publico/phantomjs"
      ["puppeteer_download_host"]="generic-puppeteer-remote"
      ["puppeteer_download_base_url"]="puppeteer"
      ["sass_binary_site"]="generic-node-sass-remote"
      ["sharp_binary_host"]="generic-sharp-remote"
      ["sharp_libvips_binary_host"]="generic-sharp-libvips-remote"
  )

  for key in "${!config[@]}"; do
      printf '%s = "%s"\n' "${key}" "${_base_url}/${config[$key]}" >>"$_npm_config"
  done

  printf '%s:_authToken=%s' \
    "$(npm config get registry | sed -e 's/^https://')" \
    "${NPM_AUTH_TOKEN:?Missing npm auth token}" \
    >>"$_npm_config"

  # Login to binarios registry with legacy auth type
  echo "${NPM_AUTH_TOKEN}" | npm login --registry=https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/ --auth-type legacy --always-auth

  if ! npm ci --cache .npm --prefer-offline; then
    cat /root/.npm/_logs/*.log
    exit 1
  fi

stages:

  • typecheck
  • lint
  • style_check

variables:
GIT_STRATEGY: fetch

typecheck:
stage: typecheck
script:
- npm run typecheck
only:
changes:
- no-gitlab-ci.yml
- package.json
- tsconfig*
- '**/*.ts'

lint:
stage: lint
script:
- npm run lint
only:
changes:
- no-gitlab-ci.yml
- package.json
- tsconfig*
- angular.json
- .gitignore
- .prettierrc.json
- .stylelintrc.json
- .eslintrc.json
- .editorconfig
- src/**/*

style_check:
stage: style_check
script:
- npm run format:check
only:
changes:
- no-gitlab-ci.yml
- .gitignore
- src//*
- '
/*.{js,ts,json,css,scss,md}'

  1. Run a pipeline
  2. See error
    Running before_script and script 00:01
    ++ npm config set strict-ssl false
    $ set -eux # collapsed multi-line command
    ++ _base_url=https://binarios.intranet.bb.com.br/artifactory
    +++ npm config get userconfig
    ++ _npm_config=/root/.npmrc
    ++ config=(['registry']='api/npm/npm/' ['appd_cdn_base_url']='generic-appdynamics-node-remote/' ['canvas_binary_host_mirror']='generic-node-canvas-remote' ['dist-url']='generic-nodejsdist-remote' ['disturl']='generic-nodejsdist-remote' ['phantomjs_cdnurl']='generic-bb-binarios-ptn-local/publico/phantomjs' ['puppeteer_download_host']='generic-puppeteer-remote' ['puppeteer_download_base_url']='puppeteer' ['sass_binary_site']='generic-node-sass-remote' ['sharp_binary_host']='generic-sharp-remote' ['sharp_libvips_binary_host']='generic-sharp-libvips-remote')
    ++ declare -A config
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' appd_cdn_base_url https://binarios.intranet.bb.com.br/artifactory/generic-appdynamics-node-remote/
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' sass_binary_site https://binarios.intranet.bb.com.br/artifactory/generic-node-sass-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' sharp_libvips_binary_host https://binarios.intranet.bb.com.br/artifactory/generic-sharp-libvips-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' registry https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' puppeteer_download_host https://binarios.intranet.bb.com.br/artifactory/generic-puppeteer-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' disturl https://binarios.intranet.bb.com.br/artifactory/generic-nodejsdist-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' phantomjs_cdnurl https://binarios.intranet.bb.com.br/artifactory/generic-bb-binarios-ptn-local/publico/phantomjs
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' canvas_binary_host_mirror https://binarios.intranet.bb.com.br/artifactory/generic-node-canvas-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' dist-url https://binarios.intranet.bb.com.br/artifactory/generic-nodejsdist-remote
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' puppeteer_download_base_url https://binarios.intranet.bb.com.br/artifactory/puppeteer
    ++ for key in "${!config[@]}"
    ++ printf '%s = "%s"\n' sharp_binary_host https://binarios.intranet.bb.com.br/artifactory/generic-sharp-remote
    +++ npm config get registry
    +++ sed -e 's/^https://'
    ++ printf %s:_authToken=%s //binarios.intranet.bb.com.br/artifactory/api/npm/npm/ [MASKED]
    ++ echo [MASKED]
    ++ npm login --registry=https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/ --auth-type legacy --always-auth
    npm notice Log in on https://binarios.intranet.bb.com.br/artifactory/api/npm/npm/
    Username: npm warn Name must be lowercase
    Username: ([MASKED])
    npm error Exit handler never called!
    npm error This is an error with npm itself. Please report this error at:
    npm error https://github.com/npm/cli/issues
    npm error A complete log of this run can be found in: /root/.npm/_logs/2025-03-14T14_06_28_918Z-debug-0.log
    Running after_script 00:00
    Uploading artifacts for failed job 00:00
    ERROR: Job failed: command terminated with exit code 1

Environment

  • npm:
  • Node.js:
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here
@dbfurrer dbfurrer added Bug thing that needs fixing Needs Triage needs review for next steps labels Mar 14, 2025
@milaninfy
Copy link
Contributor

By any chance environment variable substitution is replacing the values incorrectly ? also which version of npm is this ?

@milaninfy
Copy link
Contributor

Closing due to age. If this is still a problem please feel free to reopen this issue, or create a new issue w/ steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

2 participants