[build] Configure npm 11.x allowScripts for native module builds - #6038
Open
vrubezhny wants to merge 2 commits into
Open
[build] Configure npm 11.x allowScripts for native module builds#6038vrubezhny wants to merge 2 commits into
vrubezhny wants to merge 2 commits into
Conversation
Configure allow-scripts in .npmrc to permit install scripts for packages with native C/C++ bindings (cpu-features, ssh2, keytar, esbuild, etc.). Required since upgrading to npm 11.x (bundled with Node 24.19+) which enforces stricter allow-scripts configuration for vsce package operations. Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com> Assisted-By: Claude Haiku 4.5 <noreply@anthropic.com>
…npm 11.x compatibility Replace project-scoped npm install with npm ci in vscode:prepublish and test:prepare scripts to work with npm 11.x's allow-scripts enforcement. Use package name wildcards in allowScripts instead of specific versions to handle transitive dependency version changes. Remove --ignore-scripts flags from: - package.json vscode:prepublish and test:prepare scripts - .github/workflows/release.yml build dependencies - .github/workflows/continuous-integration-workflow.yml test setup npm 11.x enforces allow-scripts configuration, which is more secure than --ignore-scripts (explicit whitelist vs blanket ban). The allowScripts field in package.json now controls which packages can run install scripts. Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com> Assisted-By: Claude Haiku 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6038 +/- ##
===========================================
+ Coverage 32.37% 50.58% +18.20%
===========================================
Files 85 114 +29
Lines 6505 10389 +3884
Branches 1349 2334 +985
===========================================
+ Hits 2106 5255 +3149
- Misses 4399 5131 +732
- Partials 0 3 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Replace
--ignore-scriptswith npm 11.x'sallowScriptsconfiguration for more secure and compatible native module handling.npm installwithnpm ciin build scripts (works better with allowScripts).npmrc(npm 11.x prioritizes package.json allowScripts)Why: npm 11.x enforces allow-scripts configuration. The blanket
--ignore-scriptsflag conflicts with this system. The new approach is more secure (explicit whitelist vs blanket ban) and compatible with Node 24.19's npm.Fixes:
vsce packagecommand now works with Node 24.19 + npm 11.x