diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a65a8f7..e8fc458 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,8 +23,14 @@ jobs: script: | echo "SSH Connection Successful" - # Install the latest version of npm - npm install -g npm@latest + # Install nvm (Node Version Manager) and the latest compatible version of Node.js and npm + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + + # Install Node.js and npm (latest stable version) + nvm install 20 # You can specify any compatible version you need, like 20 or 22 + nvm use 20 # Check Node.js and npm versions node -v