From 5e778f4812290cf9c9827b606dcd32fa2f6e2e5a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 20 Mar 2019 10:02:56 +0100 Subject: [PATCH] Install node as part of common_startup.sh --- scripts/common_startup.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/common_startup.sh b/scripts/common_startup.sh index f224ed910b1..e5dc5d0935c 100755 --- a/scripts/common_startup.sh +++ b/scripts/common_startup.sh @@ -224,14 +224,23 @@ if [ $SKIP_CLIENT_BUILD -eq 0 ]; then fi fi +# Install node if not installed +if [ -n "$VIRTUAL_ENV" ]; then + if ! in_venv "$(command -v node)" || [ "$(node --version)" != "v$NODE_VERSION" ]; then + echo "Installing node into $VIRTUAL_ENV with nodeenv." + nodeenv -n $NODE_VERSION -p + fi +elif [ -n "$CONDA_DEFAULT_ENV" -a -n "$CONDA_EXE" ]; then + if ! in_conda_env "$(command -v node)"; then + echo "Installing node into '$CONDA_DEFAULT_ENV' Conda environment with conda." + $CONDA_EXE install --yes --override-channels --channel conda-forge --channel defaults --name $CONDA_DEFAULT_ENV node=$NODE_VERSION + fi +fi + # Build client if necessary. if [ $SKIP_CLIENT_BUILD -eq 0 ]; then # Ensure dependencies are installed if [ -n "$VIRTUAL_ENV" ]; then - if ! in_venv "$(command -v node)" || [ "$(node --version)" != "v$NODE_VERSION" ]; then - echo "Installing node into $VIRTUAL_ENV with nodeenv." - nodeenv -n $NODE_VERSION -p - fi if ! in_venv "$(command -v yarn)"; then echo "Installing yarn into $VIRTUAL_ENV with npm." npm install --global yarn