Skip to content

Fix preinstall failure when repo path contains spaces - #334529

Open
Fahad Iftikhar (Fahad090NP) wants to merge 2 commits into
microsoft:mainfrom
Fahad090NP:fix/preinstall-path-with-spaces
Open

Fix preinstall failure when repo path contains spaces#334529
Fahad Iftikhar (Fahad090NP) wants to merge 2 commits into
microsoft:mainfrom
Fahad090NP:fix/preinstall-path-with-spaces

Conversation

@Fahad090NP

Copy link
Copy Markdown

Problem

npm install fails during the preinstall step when the repository is
checked out at a path containing spaces (e.g. .../My Projects/vscode):


Restored PR: This replaces #329203, which was closed automatically when my fork was deleted from GitHub. GitHub cannot reopen a PR whose head repository was deleted, so the branch was rebuilt from the original commits (same commit messages and authorship) on top of the current main. Please review this PR in place of #329203.

@Fahad090NP

Copy link
Copy Markdown
Author

Context: this PR replaces #329203, which was closed automatically when my fork was deleted from GitHub. GitHub cannot reopen a PR whose head repository was deleted, so the branch was rebuilt from the original commits (same commit messages and authorship) on top of the current main.

Maintainers: please judge this PR in place of the closed #329203. Thank you!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change correctly avoids shell path splitting across platforms.

Pull request overview

Fixes preinstall header installation when the repository path contains spaces.

Changes:

  • Invokes node-gyp.js directly through Node.
  • Removes shell-based argument handling.
File summaries
File Description
build/npm/preinstall.ts Uses discrete process arguments for reliable path handling.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants