Skip to content

Commit

Permalink
Fix source code installation bug (#1285)
Browse files Browse the repository at this point in the history
* Fix wasm-pack not found error

* Fix source code installation bug
  • Loading branch information
cse0001 authored Dec 5, 2024
1 parent 1f27187 commit a6bab7f
Show file tree
Hide file tree
Showing 3 changed files with 1,817 additions and 1,797 deletions.
23 changes: 21 additions & 2 deletions frontend/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ cd "${SCRIPT_DIR}/.."
# https://rustup.rs/
if ! hash rustup 2>/dev/null; then
curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path -y
PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
fi


# wasm-pack
# wasm-pack will be installed by npm package
# https://rustwasm.github.io/wasm-pack/installer/
if ! hash wasm-pack 2>/dev/null; then
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cargo install wasm-pack --version 0.9.1
export PATH="$HOME/.cargo/bin:$PATH"
fi

# copy wasm-pack
Expand All @@ -45,6 +47,23 @@ fi

export PATH=$PATH


node_version=$(node -v)


if [[ "$node_version" =~ v([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
major_version=${BASH_REMATCH[1]}

if [[ $major_version -ge 17 ]]; then
echo "Node.js version is $node_version. Enabling legacy OpenSSL provider..."
export NODE_OPTIONS=--openssl-legacy-provider
else
echo "Node.js version is $node_version. No need to enable legacy OpenSSL provider."
fi
else
echo "Could not determine Node.js version."
fi

# yarn install
yarn install --frozen-lockfile --network-timeout 1000000

Expand Down
Loading

0 comments on commit a6bab7f

Please sign in to comment.