From a08a0ed844500d0496f2224dd2263efc2ef100d7 Mon Sep 17 00:00:00 2001 From: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com> Date: Tue, 18 Aug 2026 10:58:55 +0300 Subject: [PATCH] Build/Test Tools: Remove all `npx` commands. `npx` installs a missing package and runs its install scripts. Both `npx` calls in `Gruntfile.js` now use `npm exec --no`, which runs an installed binary only and fails when the package is missing. `update-browserslist-db` becomes a direct `devDependency` instead of a hoisted transitive one. Backport of r63309. --- 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 70f826ac0e33c..2099e7a2c1fb5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1707,15 +1707,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', [ 'browserslist@latest', '--update-db' ], { + 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 12471a9be52f7..1449d9b34e2b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -150,6 +150,7 @@ "source-map-loader": "5.0.0", "terser-webpack-plugin": "5.3.10", "uglify-js": "^3.17.4", + "update-browserslist-db": "1.1.1", "uuid": "9.0.1", "wait-on": "8.0.1", "webpack": "5.90.2", diff --git a/package.json b/package.json index 51ef542a6debc..c57e3b1d9a23e 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "source-map-loader": "5.0.0", "terser-webpack-plugin": "5.3.10", "uglify-js": "^3.17.4", + "update-browserslist-db": "1.1.1", "uuid": "9.0.1", "wait-on": "8.0.1", "webpack": "5.90.2",