Skip to content

Commit

Permalink
Fix nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Oct 31, 2024
1 parent e3ac609 commit 75aefde
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/executor/runnercode.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ export async function runConfigCodeFeatures(key, value, writeLog, domaindata, ss
await sshExec("pathman remove .local/opt/node/bin");
} else {
if (value == "latest" || value == "current") {
arg = "";
arg = "node";
} else if (!value || value == "stable") {
arg = "lts";
arg = "--lts";
} else {
arg = value;
}
await writeLog("$> Changing Node engine to " + (value || 'lts'));
await sshExec("command -v nvm &> /dev/null || (curl -o- https://github.com/nvm-sh/nvm/raw/refs/heads/master/install.sh | bash) && source ~/.bashrc");
const nvmPath = `https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh`;
await sshExec(`command -v nvm &> /dev/null || (curl -o- ${nvmPath} | bash) && source ~/.bashrc`);
await sshExec(`nvm install ${arg} && nvm use ${arg}`);
await sshExec("command -v corepack &> /dev/null || npm i -g corepack && corepack enable");
await sshExec(`[[ -z $COREPACK_ENABLE_AUTO_PIN ]] && echo "export COREPACK_ENABLE_AUTO_PIN=0" >> ~/.bashrc`)
Expand Down

0 comments on commit 75aefde

Please sign in to comment.