Repository navigation
fix(website): make the dev clean step work on Windows - #332
Merged
Merged
Conversation
yiliang114
commented
Oct 22, 2026
yiliang114
left a comment
Collaborator
Author
There was a problem hiding this comment.
Patrol-Run: qwen-docs-pr-review
Posting as COMMENT rather than APPROVE: gh is authenticated as the PR author here, and GitHub rejects self-approval with Can not approve your own pull request (HTTP 422). The review content is unchanged.
Approving. One-line change, and it does what the description says.
What I checked:
website/package.jsonhas notypefield, sonode -eruns as CommonJS andrequireresolves. I ran the exact command locally in both a CommonJS and a"type": "module"package: exit 0 with a seeded.nextremoved, and exit 0 again with.nextalready absent.force: truekeeps it idempotent, matchingrm -rf.devis untouched (generate → clean → next dev), andbuildstill goes throughscripts/clean-next.mjs(present, 1039 bytes), so the cache-preserving path is unchanged.- No workflow calls
npm run clean: the only references in the repo are thedevscript itself and prose in*/developers/contributing.md. Every runner isubuntu-latest, and on LinuxrmSync('.next', {recursive: true, force: true})is behaviourally equivalent torm -rf .nextregardless. fs.rmSyncneeds Node >= 14.14; the repo requires >= 22.- No dependency, lockfile, or unrelated change in the diff.
- Both checks on this head are green (Website unit tests, Translator unit tests).
Not checked: I did not run this on Windows myself — the Windows Server 2025 evidence is yours, not mine. I also did not run the full npm run dev, which you already flagged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm run devcannot start on Windows:cleanshells out torm -rf .next, and npm runs scripts throughcmd.exe, wherermdoes not exist. PowerShell is not a workaround either — therermaliasesRemove-Item, and-rfis not a valid parameter. Tracked in #331.Reproduced on Windows Server 2025 (10.0.26100, Node 22.23.1, npm 10.9.8) against this repository's
website/package.json, before the change:Changes
website/package.json—cleannow removes.nextthrough Node'sfs.rmSync, the same NodefsAPI thatbuildalready relies on throughscripts/clean-next.mjs.devstill runsgenerate → clean → next dev; no other script changes, no dependency or lockfile changes.Verification
npm run cleanexits 0 and removes a seeded.next.npm run cleanexits 0 and removes a seeded.next; the package file still parses as JSON.clean;buildkeeps its cache-preservingclean-next.mjspath.Honest limit: I did not run the full
npm run devon Windows (it needsnpm ciplus the dev server). The failing step wasclean, and that is the only thing this changes.中文说明
Windows 下
npm run dev起不来:clean调rm -rf .next,而 npm 在 Windows 上通过cmd.exe跑脚本,没有rm;PowerShell 里rm是Remove-Item的别名,-rf也不是合法参数。本仓库的build已经走scripts/clean-next.mjs,只有dev这条路还依赖 POSIX 命令;CI 和部署都在 Linux,所以只影响本地开发。改动只有一行:
clean改用 Node 的fs.rmSync。Windows Server 2025 上修改后npm run clean退出 0 且.next被删除,macOS 同样通过,build的缓存保留逻辑不动。Fixes #331