Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install nvm and use specific node version #170

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ If you're using Ubuntu, you can install node and python runtimes using our scrip
./scripts/install_dependencies.sh
```

After installing dependencies, you need to reopen the terminal and make sure that you use the specific version of nodejs. Otherwise, use the following command:

```sh
nvm use 16
```

Otherwise, the following dependencies should be installed:

- python3
Expand Down
6 changes: 6 additions & 0 deletions scripts/build_sc_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ fi

stage "Build sc-web"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

cd "${SC_WEB_PATH}"
NODE_MAJOR=16

nvm use ${NODE_MAJOR}
npm run build

stage "SC-web built successfully"
21 changes: 14 additions & 7 deletions scripts/install_deps_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ packages=(
python3
python3-pip
python3-venv
nodejs
)

if ! command -v apt> /dev/null 2>&1;
Expand All @@ -27,15 +26,23 @@ At the end run the following commands:
fi

sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

NODE_MAJOR=16
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

sudo apt-get update
sudo apt-get install --no-install-recommends -y "${packages[@]}"
sudo apt-get autoremove

export NVM_DIR="$HOME/.nvm"
if [ ! -d "$NVM_DIR" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
fi

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

NODE_MAJOR=16

nvm install ${NODE_MAJOR}
nvm use ${NODE_MAJOR}
kuanysh-zhaksylyk marked this conversation as resolved.
Show resolved Hide resolved

"${SC_WEB_PATH}/scripts/install_deps_npm.sh"
"${SC_WEB_PATH}/scripts/install_deps_python.sh"