From f1e054ed173227a5e6414e355051306307884bbc Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Mon, 17 Aug 2026 21:17:07 +0300 Subject: [PATCH] Build/Test Tools: Remove all `npx` commands. `npx` downloads and installs a package when the binary is not already present, and it runs the install scripts of every package it installs. `npm exec --no` runs an installed binary only, and fails when the package is missing. `update-browserslist-db` is now a direct `devDependency`, so the task does not depend on it staying hoisted as a transitive dependency. Backport of r63309 to the 7.0 branch. --- Gruntfile.js | 6 +++--- package-lock.json | 1 + package.json | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 90e112ef1525f..4da368013e0dc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2346,15 +2346,15 @@ module.exports = function(grunt) { grunt.registerTask( 'wp-packages:update', 'Update WordPress packages', function() { const distTag = grunt.option('dist-tag') || 'latest'; grunt.log.writeln( `Updating WordPress packages (--dist-tag=${distTag})` ); - spawn( 'npx', [ 'wp-scripts', 'packages-update', `--dist-tag=${distTag}` ], { + spawn( 'npm', [ 'exec', '--no', '--', 'wp-scripts', 'packages-update', `--dist-tag=${distTag}` ], { cwd: __dirname, stdio: 'inherit', } ); } ); grunt.registerTask( 'browserslist:update', 'Update the local database of browser supports', function() { - grunt.log.writeln( `Updating browsers list` ); - spawn( 'npx', [ 'update-browserslist-db@latest' ], { + grunt.log.writeln( 'Updating browsers list' ); + spawn( 'npm', [ 'exec', '--no', '--', 'update-browserslist-db' ], { cwd: __dirname, stdio: 'inherit', } ); diff --git a/package-lock.json b/package-lock.json index 24ad6fcc78fae..5a4e218043951 100644 --- a/package-lock.json +++ b/package-lock.json @@ -90,6 +90,7 @@ "source-map-loader": "5.0.0", "terser-webpack-plugin": "5.4.0", "typescript": "5.9.3", + "update-browserslist-db": "1.2.3", "uuid": "13.0.0", "wait-on": "9.0.4", "webpack": "5.105.4" diff --git a/package.json b/package.json index 43806c0c7e417..7614b871b6a07 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "source-map-loader": "5.0.0", "terser-webpack-plugin": "5.4.0", "typescript": "5.9.3", + "update-browserslist-db": "1.2.3", "uuid": "13.0.0", "wait-on": "9.0.4", "webpack": "5.105.4"