fix(desktop): apply pnpm purge guard so post-sync wails dev stops aborting#4024
Merged
Conversation
…rting pnpm honors npm_config_*, not PNPM_CONFIG_*, so dev's guards never took effect. After an upstream sync, pnpm 11's verify-deps-before-run reinstalls before `pnpm build`, wants to remove node_modules, and aborts with no TTY under wails dev (ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY). Pin confirm-modules-purge + verify-deps-before-run in a committed desktop/frontend/.npmrc and fix the env-var form in dev.
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.
Problem
Every desktop
./devafter an upstream sync fails at the frontend step:Root cause
Two layers:
pnpm 11
verify-deps-before-run.frontend:install(pnpm install) succeeds, butfrontend:build(pnpm build) re-verifies deps before running the script (runDepsStatusCheck). After a sync the lockfile changed, so it decidesnode_modulesis stale, triggers a reinstall that wants to removenode_modules, and — spawned bywails devwith no TTY — aborts.The guard in
devnever applied.devexportedPNPM_CONFIG_CONFIRM_MODULES_PURGE=false, but pnpm reads the npm-conventionnpm_config_*, notPNPM_CONFIG_*:pnpm config get confirm-modules-purgePNPM_CONFIG_CONFIRM_MODULES_PURGE=falseundefined❌npm_config_confirm_modules_purge=falsefalse✅So the purge/age guards were dead and the abort surfaced on every sync.
Fix
desktop/frontend/.npmrc(committed, TTY/CI/env-agnostic — the real fix; pnpm reads a project.npmrcwhen apackage.jsonis present, verified):verify-deps-before-run=false—pnpm buildno longer re-checks/reinstalls;frontend:installalready did.confirm-modules-purge=false— any purge proceeds silently instead of aborting headless.dev— fix the env-var form tonpm_config_*so the original headless intent works.minimum_release_age=0stays dev-only (not committed globally, so the supply-chain age gate is unchanged for everyone else).Test
cd desktop/frontend && rm -rf node_modules && pnpm install && cd ../.. && ./dev— frontend compiles, no purge abort. The.npmrcsettings were validated against pnpm directly (npm_config_*honored,PNPM_CONFIG_*ignored; project.npmrcread withpackage.jsonpresent).