Skip to content

Commit

Permalink
nvm set default
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Nov 1, 2024
1 parent af87758 commit dc2920b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/executor/runnercode.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ export async function runConfigCodeFeatures(key, value, writeLog, domaindata, ss
if (value == "latest" || value == "current") {
arg = "node";
} else if (!value || value == "stable" || value == "lts") {
arg = "--lts";
arg = "lts/*";
} else {
arg = value;
}
await writeLog("$> Changing Node engine to " + (value || 'lts'));
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(`nvm install ${arg} && nvm use ${arg} && nvm alias default ${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`)
await sshExec("source ~/.bashrc", false);
Expand Down

0 comments on commit dc2920b

Please sign in to comment.