npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.34k stars 3.07k forks source link

[BUG] npm error Exit handler never called! #7768

Closed akg1817 closed 1 week ago

akg1817 commented 1 week ago

Is there an existing issue for this?

This issue exists in the latest npm version

Current Behavior

while trying to perform an npm login, I am experiencing an error "Exit handler never called!" 2024-09-06T16_38_10_340Z-debug-0.log

Expected Behavior

npm login should prompt for login credentials

Steps To Reproduce

  1. In this environment...
  2. With this config...
  3. Run '...'
  4. See error...

Environment

prefix = "C:\Users\\AppData\Roaming\npm"

; "user" config from C:\Users\.npmrc

registry = "https:///artifactory/api/npm/npm-repo/"

; node bin location = C:\Program Files\nodejs\node.exe ; node version = v22.7.0 ; npm local prefix = Z:\DevSpace ; npm version = 10.8.2 ; cwd = Z:\DevSpace ; HOME = C:\Users\ ; Run npm config ls -l to show all defaults.

suelenmedinape commented 1 week ago

Have you tried using npm config ls -l ?

milaninfy commented 1 week ago

@akg1817 we are tracking similer issue here https://github.com/npm/cli/issues/7612

meanwhile can you try npm login --progress=true and check if that fixes your issue ?

akg1817 commented 1 week ago

@akg1817 we are tracking similer issue here #7612

meanwhile can you try npm login --progress=true and check if that fixes your issue ?

same issue

akg1817 commented 1 week ago

Have you tried using npm config ls -l ?

$ npm config ls -l ; "default" config from default values

_auth = (protected) access = null all = false allow-same-version = false also = null audit = true audit-level = null auth-type = "web" before = null bin-links = true browser = null ca = null cache = "C:\Users\\AppData\Local\npm-cache" cache-max = null cache-min = 0 cafile = null call = "" cert = null cidr = null color = true commit-hooks = true cpu = null depth = null description = true dev = false diff = [] diff-dst-prefix = "b/" diff-ignore-all-space = false diff-name-only = false diff-no-prefix = false diff-src-prefix = "a/" diff-text = false diff-unified = 3 dry-run = false editor = "C:\Windows\notepad.exe" engine-strict = false expect-result-count = null expect-results = null fetch-retries = 2 fetch-retry-factor = 10 fetch-retry-maxtimeout = 60000 fetch-retry-mintimeout = 10000 fetch-timeout = 300000 force = false foreground-scripts = false format-package-lock = true fund = true git = "git" git-tag-version = true global = false global-style = false globalconfig = "C:\Users\\AppData\Roaming\npm\etc\npmrc" heading = "npm" https-proxy = null if-present = false ignore-scripts = false include = [] include-staged = false include-workspace-root = false init-author-email = "" init-author-name = "" init-author-url = "" init-license = "ISC" init-module = "C:\Users\\.npm-init.js" init-version = "1.0.0" init.author.email = "" init.author.name = "" init.author.url = "" init.license = "ISC" init.module = "C:\Users\\.npm-init.js" init.version = "1.0.0" install-links = false install-strategy = "hoisted" json = false key = null legacy-bundling = false legacy-peer-deps = false libc = null link = false local-address = null location = "user" lockfile-version = null loglevel = "notice" logs-dir = null logs-max = 10 ; long = false ; overridden by cli maxsockets = 15 message = "%s" node-options = null noproxy = [""] npm-version = "10.8.2" offline = false omit = [] omit-lockfile-registry-resolved = false only = null optional = null os = null otp = null pack-destination = "." package = [] package-lock = true package-lock-only = false parseable = false prefer-dedupe = false prefer-offline = false prefer-online = false ; prefix = "C:\Program Files\nodejs" ; overridden by builtin preid = "" production = null progress = true provenance = false provenance-file = null proxy = null read-only = false rebuild-bundle = true ; registry = "https://registry.npmjs.org/" ; overridden by user replace-registry-host = "npmjs" save = true save-bundle = false save-dev = false save-exact = false save-optional = false save-peer = false save-prefix = "^" save-prod = false sbom-format = null sbom-type = "library" scope = "" script-shell = null searchexclude = "" searchlimit = 20 searchopts = "" searchstaleness = 900 shell = "C:\Windows\system32\cmd.exe" shrinkwrap = true sign-git-commit = false sign-git-tag = false strict-peer-deps = false strict-ssl = true tag = "latest" tag-version-prefix = "v" timing = false umask = 0 unicode = true update-notifier = true usage = false user-agent = "npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}" userconfig = "C:\Users\\.npmrc" version = false versions = false viewer = "browser" which = null workspace = [] workspaces = null workspaces-update = true yes = null

; "builtin" config from C:\Program Files\nodejs\node_modules\npm\npmrc

prefix = "C:\Users\\AppData\Roaming\npm"

; "user" config from C:\Users\.npmrc

registry = "https:///artifactory/api/npm/npm-repo/"

; "cli" config from command line options

long = true

milaninfy commented 1 week ago

@akg1817 Check if npm login --auth-type=legacy works ?

akg1817 commented 1 week ago

@akg1817 Check if npm login --auth-type=legacy works ?

I'm sure this will work, but I would like to prevent from having to login every time my password changes. Why does the token approach not work?

milaninfy commented 1 week ago

@akg1817 we are tracking similer issue here #7612

The exact cause/test scenario of this issue is still ambiguous and it happens intermittently for windows mainly, as a workaround you can use auth-type=legacy if it works for you.

I am going to attach/mention this issue in the one which we are tracking and will close this as duplicate.