In order to add the opportunity to install npm by other plugins (namely mouf/nodejs-installer), I moved the check on npm installation from the activate method to the onPostUpdateInstall method.
With the changes in this PR, this works nicely, even on a machine with no nodejs installed.
Note: I updated the "mouf/nodejs-installer" so that it prepends vendor/bin to the PATH. Therefore, when composer-extra-assets is triggered, it loads node / npm from the vendor/bin directory automatically.
This is directly related to #4 .
In order to add the opportunity to install npm by other plugins (namely mouf/nodejs-installer), I moved the check on npm installation from the
activate
method to theonPostUpdateInstall
method.This is my test
composer.json
file:With the changes in this PR, this works nicely, even on a machine with no nodejs installed.
Note: I updated the "mouf/nodejs-installer" so that it prepends vendor/bin to the PATH. Therefore, when composer-extra-assets is triggered, it loads node / npm from the vendor/bin directory automatically.