oclif / oclif/plugin-plugins

Frustrating MacOS ENOTEMPTY rename issues on newer npm versions

Open
#1,292 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51
Forks
25
Avg merge
6h 22m
Merged PRs (30d)
5

Description

Describe the bug

I think Heroku CLI maybe doesn't face this because of using an older version of node, though I haven't double-checked with the versions of NPM used with it.

Sometimes updating one of my plugins causes a frustrating edge case causing the update to file, and requires additional steps to clean it up and solve.

To Reproduce
Steps to reproduce the behaviour are a little challenging, but might be possible creating a new CLI that bundles a modern version of npm.

❯ mycli update
Fetching information about CLI update [channel: alpha] [dist-tag: alpha-darwin-arm64]... done
Restarting CLI to update plugins with the new version
Updating CLI from 16.0.20-alpha-darwin-arm64.0 to 16.0.21-alpha-darwin-arm64.0... done
Fetching information about CLI update [channel: alpha] [dist-tag: alpha-darwin-arm64]... already up-to-date (16.0.21-alpha-darwin-arm64.0)

Updating 5 installed plugin(s)...
 ›   Notice: Do not forget to refresh your completion cache by restarting your shell or by running
 ›
 ›       $ source ~/.zshrc
 ›       # OR
 ›       $ source <(mycli completion zsh)
 ›
 ›    More info for setting up completion on other shells can be found by running `mycli completion --help`
 ›
npm error code ENOTEMPTY
npm error syscall rename
npm error path /Users/myuser/.local/share/@myorganisation/mycli/node_modules/@myorganisation/myplugin
npm error dest /Users/myuser/.local/share/@myorganisation/mycli/node_modules/@myorganisation/.myplugin-6EHKOOFt
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename '/Users/myuser/.local/share/@myorganisation/mycli/node_modules/@myorganisation/myplugin' -> '/Users/myuser/.local/share/@myorganisation/mycli/node_modules/@myorganisation/.myplugin-6EHKOOFt'
npm error A complete log of this run can be found in: /Users/myuser/.npm/_logs/2026-03-20T12_50_38_218Z-debug-0.log
@myorganisation/mycli: Updating plugins... !

Expected behaviour

Plugins to happily successfully update

Screenshots
N/A

Environment (please complete the following information):

  • OS & version: MacOS Tahoe 26.3.1
  • Shell/terminal & version zsh 6.9
  • Node: 24.11.1
  • NPM: 10.9.6

Additional context

Some long-lived related NPM issues:

https://github.com/npm/cli/issues/5825
https://github.com/npm/cli/issues/6370

Claude + Amp related issues from it

https://github.com/anthropics/claude-code/issues/7373
https://ampcode.com/threads/T-1c48ef54-b8b8-4d8a-aa20-33b7c897f9fe

Contributor guide

No contributing guide indexed for this repository

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

Start with the mycli update entry point on macOS using Node 24.11.1 and npm 10.9.6, and inspect the plugin-update path around the reported ENOTEMPTY rename. Use the linked npm issues and generated npm log as context; done means installed plugins update successfully without leaving the failed directory state.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.