diff --git a/web/app/Installers/Server/Applications/NodeJsInstaller.php b/web/app/Installers/Server/Applications/NodeJsInstaller.php index 8e089e8..e46f461 100644 --- a/web/app/Installers/Server/Applications/NodeJsInstaller.php +++ b/web/app/Installers/Server/Applications/NodeJsInstaller.php @@ -22,11 +22,9 @@ class NodeJsInstaller { $commands = []; $commands[] = 'apt-get install -y npm'; - foreach ($this->nodejsVersions as $nodejsVersion) { - $commands[] = 'curl -sL https://deb.nodesource.com/setup_'.$nodejsVersion.'.x -o /tmp/nodesource'.$nodejsVersion.'_setup.sh'; - $commands[] = 'sudo bash /tmp/nodesource'.$nodejsVersion.'_setup.sh'; - } - $commands[] = 'sudo apt-get install -y install nodejs'; + $commands[] = 'curl -sL https://deb.nodesource.com/setup_20.x -o /tmp/nodesource_setup.sh'; + $commands[] = 'bash /tmp/nodesource_setup.sh'; + $commands[] = 'apt-get install nodejs -y'; // Install Apache Passenger $commands[] = 'curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null'; diff --git a/web/tests/Unit/HostingSubscriptionWithNodeJSCreateTest.php b/web/tests/Unit/HostingSubscriptionWithNodeJSCreateTest.php index 2afb160..92f0729 100644 --- a/web/tests/Unit/HostingSubscriptionWithNodeJSCreateTest.php +++ b/web/tests/Unit/HostingSubscriptionWithNodeJSCreateTest.php @@ -48,6 +48,10 @@ class HostingSubscriptionWithNodeJSCreateTest extends ActionTestCase // // Make Apache+PHP Application Server with all supported php versions and modules $installLogFilePath = storage_path('install-apache-nodejs-log-unit-test.txt'); + if (is_file($installLogFilePath)) { + unlink($installLogFilePath); + } + $phpInstaller = new NodeJsInstaller(); $phpInstaller->setNodeJsVersions(array_keys(SupportedApplicationTypes::getNodeJsVersions())); $phpInstaller->setLogFilePath($installLogFilePath);