Download deploy/scripts/install_node.sh from eduzrh/helloworld: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/datasets/eduzrh/helloworld/resolve/main/deploy/scripts/install_node.sh
- Command line
-
hf download hf://datasets/eduzrh/helloworld/deploy/scripts/install_node.sh
-
curl -L -o install_node.sh https://huggingface.co/datasets/eduzrh/helloworld/resolve/main/deploy/scripts/install_node.sh
941 Bytes
| # 安装 Node 24(npmmirror 二进制分发)到 /data/runtime/node | |
| set -u | |
| LOG=/data/logs/install_node.log | |
| exec >>"$LOG" 2>&1 | |
| echo "=== $(date -Is) start ===" | |
| V=v24.11.1 | |
| cd /tmp | |
| curl -fsSLO "https://registry.npmmirror.com/-/binary/node/${V}/node-${V}-linux-x64.tar.xz" \ | |
| || curl -fsSLO "https://cdn.npmmirror.com/binaries/node/${V}/node-${V}-linux-x64.tar.xz" | |
| ls -lh node-${V}-linux-x64.tar.xz | |
| sudo mkdir -p /data/runtime | |
| sudo tar -xJf node-${V}-linux-x64.tar.xz -C /data/runtime | |
| sudo rm -rf /data/runtime/node && sudo mv /data/runtime/node-${V}-linux-x64 /data/runtime/node | |
| sudo ln -sf /data/runtime/node/bin/node /usr/local/bin/node | |
| sudo ln -sf /data/runtime/node/bin/npm /usr/local/bin/npm | |
| sudo ln -sf /data/runtime/node/bin/npx /usr/local/bin/npx | |
| node -v; npm -v | |
| npm config set registry https://registry.npmmirror.com --location=global | |
| npm config get registry | |
| echo "=== $(date -Is) done ===" | |
| touch /data/logs/.node_ready | |