cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] Exit handler never called!

Open Natemo2625 opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

This issue exists in the latest npm version

  • [X] I am using the latest npm

Current Behavior

On executing npm i it tells me that the exit handler was never called on npm version 8.19.1 on Termux for Android

Expected Behavior

I expected it to install the npm packages as it had in the past

Steps To Reproduce

  1. In Termux on Android (F-Droid version of Termux)
  2. With this config... After running pkg install nodejs and npm i -g npm to set it up
  3. Run 'npm i'
  4. See error Exit handler never called!

Environment

  • npm: 8.19.1
  • Node.js: 18.7.0
  • OS Name: Android 12
  • System Model Name: Samsung Galaxy A32 5G
  • npm config:
; npm config ls
; "user" config from /data/data/com.termux/files/home/.npmrc

foreground-scripts = true

; node bin location = /data/data/com.termux/files/usr/bin/node
; node version = v18.7.0
; npm local prefix = /storage/emulated/0/Download/Botemo
; npm version = 8.19.1
; cwd = /storage/emulated/0/Download/Botemo
; HOME = /data/data/com.termux/files/home

Natemo2625 avatar Sep 09 '22 16:09 Natemo2625

Was originally on replit so here's the link for it to see the package.json if needed https://replit.com/@Natemo6348/Botemo#package.json

Natemo2625 avatar Sep 09 '22 16:09 Natemo2625

I attempted to both update nodejs and npm with no results, edited original comment to reflect the new versions

Natemo2625 avatar Sep 09 '22 16:09 Natemo2625

Removing package-lock.json causes it to return the same error for every package I attempt to install with npm. Example:

npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/@discordjs%2fopus reason: Invalid response body while trying to fetch https://registry.npmjs.org/@discordjs%2fopus: EACCES: permission denied, link '/data/data/com.termux/files/home/.npm/_cacache/tmp/38614c69' -> '/data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/93/23/c4178d08f033b89e054b62f42fe1958cfeb66cae6d9ff61c29eea05d8b2c5b68d906c16a1d5e7564611683635498d4df3916bdab3202950845361d4e86cb'

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2022-09-12T10_14_03_664Z-debug-0.log```

Natemo2625 avatar Sep 12 '22 10:09 Natemo2625

Can you try without termux? It sets PREFIX which can conflict with npm.

ljharb avatar Sep 12 '22 16:09 ljharb

Can you try without termux? It sets PREFIX which can conflict with npm.

Do you know of any alternatives on Android I can try? Edit: this has all worked in the past, so I don't think termux is causing the problem (I could be wrong but that's what I think)

Natemo2625 avatar Sep 12 '22 20:09 Natemo2625

I figured out the problem, using npm to globally update npm breaks it in Termux, although I'm not sure why it had an error prior to updating npm since it's just gone

Natemo2625 avatar Sep 12 '22 22:09 Natemo2625