From 7563c956cd267657d395247cdfa330b60c262bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alfaiate?= Date: Tue, 18 Aug 2026 11:19:22 +0700 Subject: [PATCH] Add npx binary detection --- contrib/npm.php | 4 ++++ docs/contrib/npm.md | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/contrib/npm.php b/contrib/npm.php index 3d8299335..f869577cb 100644 --- a/contrib/npm.php +++ b/contrib/npm.php @@ -19,6 +19,10 @@ return which('npm'); }); +set('bin/npx', function () { + return which('npx'); +}); + // Uses `npm ci` command. This command is similar to npm install, // except it's meant to be used in automated environments such as // test platforms, continuous integration, and deployment -- or diff --git a/docs/contrib/npm.md b/docs/contrib/npm.md index a28be9a5e..e9de0d148 100644 --- a/docs/contrib/npm.md +++ b/docs/contrib/npm.md @@ -38,11 +38,21 @@ return which('npm'); ``` +### bin/npx +[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L22) + + + +```php title="Default value" +return which('npx'); +``` + + ## Tasks ### npm\:install {#npm-install} -[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L28) +[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L32) Installs npm packages. @@ -54,7 +64,7 @@ install of your dependencies. ### npm\:build {#npm-build} -[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L33) +[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L37) Runs npm build.