Skip to content

fix(env): preserve managed npm in node child processes#1938

Merged
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/fix-node-managed-pm-path
Jun 25, 2026
Merged

fix(env): preserve managed npm in node child processes#1938
fengmk2 merged 10 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/fix-node-managed-pm-path

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Close #1935, similar to #1654

The current node shim prepends the managed Node.js bin directory to PATH for child processes. That keeps node resolution stable, but it also lets the Node-bundled npm and npx shadow a project-declared managed npm version.

This PR keeps the Node runtime bin on PATH, and when the current project declares npm through packageManager or devEngines.packageManager, it also prepends the resolved managed npm bin directory ahead of the Node runtime bin. It means child processes spawned from node use the same npm version that Vite+ resolves for the project.

🤖 Generated with Codex.

@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 3876c03
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a3c78c165f95a0008f48be6

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 4317eb15a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@liangmiQwQ liangmiQwQ marked this pull request as ready for review June 24, 2026 15:22

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liangmiQwQ Nice!

@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels Jun 24, 2026
@liangmiQwQ liangmiQwQ requested a review from fengmk2 June 25, 2026 00:39
@fengmk2 fengmk2 merged commit f7d2849 into voidzero-dev:main Jun 25, 2026
92 checks passed
@liangmiQwQ liangmiQwQ deleted the liang/codex/fix-node-managed-pm-path branch June 25, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm shim is not used when running the npm command from a script

2 participants