Skip to content

fix: clean and set npm_config_cache - #712

Open
guhaiyan0221 wants to merge 1 commit into
bytedance:mainfrom
guhaiyan0221:fix_remove_npm
Open

fix: clean and set npm_config_cache#712
guhaiyan0221 wants to merge 1 commit into
bytedance:mainfrom
guhaiyan0221:fix_remove_npm

Conversation

@guhaiyan0221

@guhaiyan0221 guhaiyan0221 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: close #714

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🔨 Refactoring (no logic changes)
  • 🔧 Build/CI or Infrastructure changes
  • 📝 Documentation only

Description

Fix the blog Markdown lint CI failure caused by npx dynamically installing markdownlint-cli2 into a corrupted _npx cache directory.

The markdownlint-blog pre-commit hook now uses pre-commit's Node environment management instead of invoking npx at hook runtime. This pins markdownlint-cli2@0.17.2 through additional_dependencies and
runs the installed markdownlint-cli2 binary directly.

For CI, the pre-commit job now uses a job-scoped npm cache under ${{ runner.temp }}/npm-cache and clears it before running hooks, so npm does not reuse stale or corrupted cache content from the runner.

The standalone blog markdown check also uses a job-scoped npm cache for its direct npx invocation.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).

  • Positive Impact: I have run benchmarks.

    Click to view Benchmark Results
    Paste your google-benchmark or TPC-H results here.
    Before: 10.5s
    After:   8.2s  (+20%)
    
  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

Please describe the changes in this PR

Release Note:

Release Note:
- fix: clean and set npm_config_cache

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No

  • Yes (Description: ...)

    Click to view Breaking Changes
    Breaking Changes:
    - Description of the breaking change.
    - Possible solutions or workarounds.
    - Any other relevant information.
    

@guhaiyan0221 guhaiyan0221 changed the title fix: remove npm cache fix: clean and set npm_config_cache Jul 6, 2026
@guhaiyan0221
guhaiyan0221 requested a review from kexianda July 6, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] ci broken due to npm error

1 participant