public function install(Composer $composer, bool $isDevMode = true)
    {
        $this->io->write(
            '<info>Installing NPM dependencies for root project</info>'
        );

        $package = $composer->getPackage();

        if ($this->isDependantPackage($package, $isDevMode)) {
            $isNpmAvailable = $this->client->isAvailable();
            $extra = $package->getExtra();

            if (!$isNpmAvailable && $this->isPackageOptional($extra)) {
                $this->io->write('Skipping as NPM is unavailable');
            } else {
                $this->client
                    ->install(null, $isDevMode, $this->packageTimeout($extra));
            }
        } else {
            $this->io->write('Nothing to install');
        }

        $this->installForVendors($composer);
    }
public function install(Composer $composer, bool $isDevMode = true)
    {
        $this->io->write(
            '<info>Installing NPM dependencies for root project</info>'
        );

        $package = $composer->getPackage();

        if ($this->isDependantPackage($package, $isDevMode)) {
            $isNpmAvailable = $this->client->isAvailable();
            $extra = $package->getExtra();

            if (!$isNpmAvailable && $this->isPackageOptional($extra)) {
                $this->io->write('Skipping as NPM is unavailable');
            } else {
                $this->client
                    ->install(null, $isDevMode, $this->packageTimeout($extra));
            }
        } else {
            $this->io->write('Nothing to install');
        }

        $this->installForVendors($composer);
    }
public function install ( Composer $ composer , bool $ isDevMode = true ) { $ this -> io -> write ( '<info>Installing NPM dependencies for root project</info>' ) ; $ package = $ composer -> getPackage ( ) ; if ( $ this -> isDependantPackage ( $ package , $ isDevMode ) ) { $ isNpmAvailable = $ this -> client -> isAvailable ( ) ; $ extra = $ package -> getExtra ( ) ; if ( ! $ isNpmAvailable && $ this -> isPackageOptional ( $ extra ) ) { $ this -> io -> write ( 'Skipping as NPM is unavailable' ) ; } else { $ this -> client -> install ( null , $ isDevMode , $ this -> packageTimeout ( $ extra ) ) ; } } else { $ this -> io -> write ( 'Nothing to install' ) ; } $ this -> installForVendors ( $ composer ) ; }
Install NPM dependencies for a Composer project and its dependencies.

@param Composer $composer  The main Composer object.
@param bool     $isDevMode True if dev mode is enabled.

@throws NpmNotFoundException      If the npm executable cannot be located.
@throws NpmCommandFailedException If the operation fails.
Install NPM dependencies for a Composer project and its dependencies .