From ab8e1a9be177232c61f7d7d51513c32118cff7a8 Mon Sep 17 00:00:00 2001 From: 0xrohitgarg Date: Wed, 23 Oct 2024 17:48:19 +0530 Subject: [PATCH] activate nvm on run, and dont set installed nvm as default in setup --- frontend/Makefile | 7 +++++++ setup.sh | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/Makefile b/frontend/Makefile index 8ba5b06..658319e 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -21,4 +21,11 @@ update: @npm update run: + @if [ -f "$$NVM_DIR/nvm.sh" ]; then \ + . "$$NVM_DIR/nvm.sh" && nvm use 22.8.0 || echo "⚠️ Warning: Unable to switch to Node.js 22.8.0. Continuing with current version."; \ + elif [ -f "$$HOME/.nvm/nvm.sh" ]; then \ + . "$$HOME/.nvm/nvm.sh" && nvm use 22.8.0 || echo "⚠️ Warning: Unable to switch to Node.js 22.8.0. Continuing with current version."; \ + else \ + echo "ℹ️ Note: nvm is not installed or not properly configured. Using system's default Node.js version."; \ + fi @npm run dev diff --git a/setup.sh b/setup.sh index 04f7ba6..23826be 100755 --- a/setup.sh +++ b/setup.sh @@ -71,7 +71,6 @@ install_node_with_nvm() { if confirm "Would you like to install Node.js version $node_version using nvm?"; then nvm install $node_version nvm use $node_version - nvm alias default $node_version echo "✅ Node.js $node_version and npm have been successfully installed with nvm!" else echo "⏭️ Skipping Node.js installation."