Skip to content

Conversation

@deepak1556
Copy link
Collaborator

@deepak1556 deepak1556 self-assigned this Nov 3, 2025
Copilot AI review requested due to automatic review settings November 3, 2025 19:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates npm configuration from .npmrc files to package.json config sections across the VS Code repository. The primary motivation is to consolidate build configuration into standard package.json format, replacing scattered .npmrc files with centralized config sections.

Key changes:

  • Replaces .npmrc configuration files with config sections in package.json files for node-gyp settings
  • Updates all code that parsed .npmrc files to instead read from package.json config sections
  • Removes .npmrc files from 40+ locations across the codebase (root, build, remote, extensions, and test directories)
  • Updates Node.js and npm version requirements (Node.js > v24.11.0 or >= v25.0.0, npm >= 11.6.2)

Reviewed Changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.npmrc Removes node-gyp configuration, retains only legacy-peer-deps setting
.nvmrc Updates Node.js version from 22.20.0 to 25.0.0
package.json Adds config section with Electron build settings (node_gyp_disturl, node_gyp_target, ms_build_id, etc.)
remote/package.json Adds config section with Node.js build settings
build/package.json Adds config section with Node.js build settings without target version
remote/.npmrc Deleted (configuration moved to package.json)
build/.npmrc Deleted (configuration moved to package.json)
extensions/**/.npmrc Deleted from 33 extension directories (only contained legacy-peer-deps and timeout)
test/**/.npmrc Deleted from test directories
test/unit/node/index.js Updates code to parse node version from remote/package.json config instead of .npmrc
build/npm/preinstall.js Updates version check to Node.js > v24.11.0 and npm >= 11.6.2; updates getHeaderInfo to read from package.json
build/npm/postinstall.js Renames setNpmrcConfig to setNodeGypConfig; updates environment variable names to use npm_package_config_* prefix
build/lib/util.ts & .js Updates getElectronVersion to read from package.json config
build/lib/node.ts & .js Updates version extraction to read from remote/package.json config
build/darwin/sign.ts & .js Updates getElectronVersion to read from package.json config
build/linux/debian/install-sysroot.ts & .js Updates getElectronVersion to read from package.json config
build/gulpfile.reh.js Updates getNodeVersion to read from remote/package.json config
build/azure-pipelines/common/computeNodeModulesCacheKey.ts & .js Removes .npmrc files from cache key computation

*--------------------------------------------------------------------------------------------*/

const nodeVersion = /^(\d+)\.(\d+)\.(\d+)/.exec(process.versions.node);
const npmVersion = /^(\d+)\.(\d+)\.(\d+)/.exec(process.env.npm_config_npm_version);
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

Potential null reference error: process.env.npm_config_npm_version may be undefined, causing exec() to return null. This will cause a crash when accessing npmVersion[1] on line 11. Add null checking or provide a fallback value.

Copilot uses AI. Check for mistakes.
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.

2 participants