diff --git a/README.md b/README.md index e275dc16..f34f07f0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/scripts/build_sc_web.sh b/scripts/build_sc_web.sh index a13edd01..7711d0ca 100755 --- a/scripts/build_sc_web.sh +++ b/scripts/build_sc_web.sh @@ -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" diff --git a/scripts/install_deps_ubuntu.sh b/scripts/install_deps_ubuntu.sh index 4ac7db9f..9ebaf3af 100755 --- a/scripts/install_deps_ubuntu.sh +++ b/scripts/install_deps_ubuntu.sh @@ -10,7 +10,6 @@ packages=( python3 python3-pip python3-venv - nodejs ) if ! command -v apt> /dev/null 2>&1; @@ -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} + "${SC_WEB_PATH}/scripts/install_deps_npm.sh" "${SC_WEB_PATH}/scripts/install_deps_python.sh"