一键导入
npm-codex-enotempty-repair
Fix npm global install failures for @openai/codex when ENOTEMPTY rename conflicts occur in the global node_modules path.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix npm global install failures for @openai/codex when ENOTEMPTY rename conflicts occur in the global node_modules path.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Write skill_for_setup/SKILL.md and skill_for_setup/README.md for any open-source library in the open_supports/ system. Use after scripts_for_install/ is complete. Implements the script-first pattern: primary path runs the install script; fallback follows repo_readme_summary.md Part 2.
Use when creating or updating an open_supports support package end-to-end, especially when coordinating repo summary, install script, setup skill, clarification, resume, or optional install verification.
帮助用户安装并配置 OpenSpec。主路径:运行支持包内的一键脚本;脚本不可用时回退到 repo_readme_summary.md 第 2 部分。范围:安装/更新 CLI、验证版本、可选初始化或更新项目;不含卸载、删除生成文件或详细使用教程。
Write scripts_for_install/install.sh for any open-source library in the open_supports/ system. Use when adding a new support package that needs a one-click installation script. Produces a POSIX sh script with platform detection, flag-driven interface, and idempotent behavior.
Write repo_readme_summary.md for any open-source library in the open_supports/ system. Use when adding a new support package or updating an existing summary. Produces a concise 5-part structured document distilled from the official README.
Write optional usage_examples.md for an open_supports support package when a library has meaningful post-install workflows. Use after repo summary, install script, and setup Skill are complete.
基于 SOC 职业分类
| name | npm-codex-enotempty-repair |
| description | Fix npm global install failures for @openai/codex when ENOTEMPTY rename conflicts occur in the global node_modules path. |
| argument-hint | optional: explicit npm global prefix path |
Use this Skill when the user reports an error like:
npm ERR! code ENOTEMPTYrename .../@openai/codex -> .../@openai/.codex-*Recover from stale temporary directories left by failed npm reify moves, then reinstall Codex CLI cleanly.
npm prefix -g
npm root -g
Expected affected paths:
<PREFIX>/lib/node_modules/@openai/codex<PREFIX>/lib/node_modules/@openai/.codex-*<PREFIX>/bin/codex<PREFIX>/bin/.codex-*PREFIX="$(npm prefix -g)"
find "$PREFIX/lib/node_modules/@openai" -maxdepth 1 -type d -name '.codex-*' -exec rm -rf {} + 2>/dev/null || true
find "$PREFIX/bin" -maxdepth 1 -type f -name '.codex-*' -delete 2>/dev/null || true
npm uninstall -g @openai/codex || true
PREFIX="$(npm prefix -g)"
rm -rf "$PREFIX/lib/node_modules/@openai/codex"
rm -f "$PREFIX/bin/codex"
find "$PREFIX/lib/node_modules/@openai" -maxdepth 1 -type d -name '.codex-*' -exec rm -rf {} + 2>/dev/null || true
find "$PREFIX/bin" -maxdepth 1 -type f -name '.codex-*' -delete 2>/dev/null || true
npm install -g @openai/codex@latest
command -v codex
codex --version
After running the repair, report:
.codex-* directories were found and removed;codex --version output.