npm / npm/cli

[BUG] npm ERR! ENOTEMPTY: directory not empty, rename '/usr/local/lib/node_modules/tls-test' -> '/usr/local/lib/node_modules/.tls-test-ow7IxLcQ'

Open
#5,825 7 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

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

installation of https://tls-test.npmjs.com/tls-test-1.0.0.tgz fails

i have tried manually rename '/usr/local/lib/node_modules/tls-test' -> '/usr/local/lib/node_modules/.tls-test-ow7IxLcQ'
clearitg 'usr/local/lib/node_modules/.tls-test-ow7IxLcQ'
clearing cache
downgrade and upgrading npm

when i was trying to solve this problem myself sometimes it throws 'error handler never called error'

Expected Behavior

install https://tls-test.npmjs.com/tls-test-1.0.0.tgz and show success message

Steps To Reproduce
  1. In this environment
    Termux 0.118.0
    PWD=/root/node/tutorial
    LS_OPTIONS=--color=auto HOME=/root
    LANG=C.UTF-8 TERM=xterm-256color
    DISPLAY=:1 SHLVL=1
    XDG_DATA_DIRS=/root/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/root/buildAPKs/bin/ _=/usr/bin/printenv OLDPWD=/root/node

  2. With this config...

  3. Run 'npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz'

  4. See error
    npm ERR! code ENOTEMPTY
    npm ERR! syscall rename npm ERR! path /usr/local/lib/node_modules/tls-test
    npm ERR! dest /usr/local/lib/node_modules/.tls-test-ow7IxLcQ npm ERR! errno -39
    npm ERR! ENOTEMPTY: directory not empty, rename '/usr/local/lib/node_modules/tls-test' -> '/usr/local/lib/node_modules/.tls-test-ow7IxLcQ'
    npm ERR! A complete log of this run can be found in:
    npm ERR! /root/.npm/_logs/2022-11-08T16_36_52_883Z-debug-0.log

Environment
  • npm: 8.19.3
  • Node.js: 18.12.0
  • OS Name: Debian GNU/Linux 10 (buster)
  • System Model Name: Realme C25s
  • npm config:
; "user" config from /root/.npmrc                                             
registry = "http://registry.npmjs.org/"                                       strict-ssl = false
                                                                              ; node bin location = /usr/local/bin/node
; node version = v18.12.0                                                     ; npm local prefix = /root                                                    ; npm version = 8.19.3                                                        ; cwd = /root/node/tutorial
; HOME = /root                                                                ; Run `npm config ls -l` to show all defaults.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source file or test. Start by reproducing the global install command in the reported Termux/Debian environment and inspect /root/.npm/_logs/2022-11-08T16_36_52_883Z-debug-0.log. Done means the tls-test tarball installs successfully without ENOTEMPTY.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.