Conversation
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.
Task: AdminForth/1956
Problem
pnpm 12 (released 2026-08-26) no longer ships a JS entrypoint. Its
bin.pnpmnow points to a native executable thatinstall.jsdrops into the package root from@pnpm/exe.<platform>; pnpm 11 and earlier shippedbin/pnpm.mjs.We launch the package manager as
node <nodedir>/pnpm .... With pnpm 12 node gets an ELF file (the Linux executable format — a binary, not source), tries to parse it as an ES module and dies:Reported by a user on
npx adminforth create-app, but it hits the same way incodeInjector— sonpm run devand custom-component installs break too for anyone on pnpm 12.Fix
isNodeScriptBin()reads the first two bytes of the resolved bin:#!means a JS entrypoint that still gets launched with the current node binary (pnpm <= 11, npm, corepack shims), anything else is a self-contained executable that is launched directly. Unreadable path keeps the old behaviour.Applied at the three Unix launch sites:
commands/createApp/utils.js—pnpm install/npm installduring scaffoldingmodules/codeInjector.ts—runPackageManagerShell()(custom components install)modules/codeInjector.ts— dev server spawn (pnpm run dev)Windows branches already invoke
pnpm.cmd/npm.cmdthrough the shell and are untouched.Verification
Built a node bin dir containing a real node plus the native pnpm 12.5.1 binary, so
process.execPathresolution matches a user's nvm layout:ELF/SyntaxErroraboveDone in 19ms using pnpm v12.5.1Detection results on real binaries: pnpm 11.27.1
bin/pnpm.mjs->true(launched with node), pnpm 12.5.1 native bin ->false(launched directly), npm ->true, missing path ->true.tsc --noEmitclean (only the pre-existing missing-chokidarerror in this checkout).Please test
Ivan Husev (assigned on AdminForth/1956) — could you retest on your machine with pnpm 12 installed globally:
npx adminforth create-appwith pnpm selectednpm run devin the created app, plus one custom component so the component install path runs