Repository navigation
fix: gate npm installs on the node version preflight - #7210
Conversation
|
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Restore the up-front Node.js check during init when npm is explicitly preferred: install_bun skips bun setup in that case, so deferring the check let init finish on an unsupported Node.js. Only the npm-fallback case is deferred until after bun setup. Reuse the executor already resolved at run time instead of looking up package managers again, drop the unreachable empty-list guard, and trim the comments. Tests cover explicit-npm init, the error message and the bun lockfile pruning; the host-probe test that could not fail is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01F81q6RZRQqtp3nAniyCXV5
str(Path("/usr/bin/bun")) is backslash-separated on Windows, so compare
against the same Path object the discovery stub returns.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01F81q6RZRQqtp3nAniyCXV5
Closes #6976.
A warm app running
REFLEX_USE_NPM=1 reflex runwith unsupported Node.js could install frontend packages and persist npm lockfiles before failing its version check. Later plain runs would then use npm because of the saved lockfiles.Check the selected package manager's Node.js requirement before npm installation or lockfile synchronization. This also covers npm selected when Bun is unavailable. Keep Bun independent of the Node.js version, and defer initialization checks so they do not prevent Bun setup.
Regression tests cover rejected and supported npm installs, Bun, and initialization. Mocked package-manager tests also stub their Node.js prerequisite and fail if they inspect the host Node installation. The changelog fragment uses this PR's number.
Validation: the full unit suite, Ruff lint and formatting, Pyright, and codespell pass. The focused install tests also pass with a shim reporting an unsupported Node.js version. In a real app, the base branch changed persisted lockfiles before rejecting Node.js; this branch left them byte-identical and the next plain run used Bun. Supported npm and Bun browser interactions and production exports passed.