Skip to content

Conversation

@mike-day
Copy link
Collaborator

This is just some playing around to see if auto-switching the node version works.

if [[ ${availablenodeversions[*]} =~ v14* ]];
then
echo "v14 found. Switching your current version...";
nvm use 14;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that nvm use only uses the target version while the shell is running. So if you are using a different version of node (say, 18.16) and run node -v after the script stops, you will be shown as still using 18.16.

I think this is okay since the other child node dependencies will be installed while using node 14 in the shell, but I could be wrong...

We could also change the user's default node version to make the change persist.

echo "v14 found. Switching your current version...";
nvm use 14;
else
echo "Please install node v14, then run this script again.";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This installation could probably be automated as well, though we will have to check python dependencies etc as the install might fail for an older version of node with a current version of python installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants