Skip to content

[BUG] Exit handler never called when calling npm adduser #6505

Closed
@gabrielyotoo

Description

@gabrielyotoo

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

When I run the command

npm adduser --registry my_register <<!
$USERNAME
$PASSWORD
$EMAIL
!

to log in to a registry, I receive the error

npm notice Log in on MY_REGISTER
Username: myuser
Password: npm ERR! Exit handler never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2023-05-26T14_31_01_533Z-debug-0.log

Is there any other methods to log in automatically via shell script? I am unable to use expect because some users of the script run it on windows.

Expected Behavior

The expected behavior is to log in to the registry when running

npm adduser --registry my_register <<!
$USERNAME
$PASSWORD
$EMAIL
!

Steps To Reproduce

  1. In MacOS
  2. npm version 8.19.4
  3. Try to run
npm adduser --registry my_register <<!
$USERNAME
$PASSWORD
$EMAIL
!
  1. See error

Environment

  • npm: 8.19.4
  • Node.js: v16.15.1
  • OS Name: MacOS 13.2 (22D49)
  • System Model Name: MacBook Pro M1
  • npm config:
; "user" config from /Users/me/.npmrc

//my-registry/:_authToken = (protected) 

; node bin location = /Users/me/.nvm/versions/node/v16.15.1/bin/node
; node version = v16.15.1
; npm local prefix = /Users/me/projects/my_app
; npm version = 8.19.4
; cwd = /Users/me/projects/my_app
; HOME = /Users/me
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions