mirror of
https://github.com/GSManagerXZ/GameServerManager.git
synced 2025-10-04 05:41:54 +08:00
29 lines
889 B
Bash
Executable file
29 lines
889 B
Bash
Executable file
#!/bin/bash
|
|
# ARM64 npm 脚本封装
|
|
# 可以作为独立的 npm 命令使用
|
|
|
|
# ARM64 Node.js 路径配置
|
|
NODE_BIN="/home/xiaozhu/qemu/Node/node-v20.19.0-linux-arm64/bin/node"
|
|
NPM_CLI="/home/xiaozhu/qemu/Node/node-v20.19.0-linux-arm64/lib/node_modules/npm/bin/npm-cli.js"
|
|
|
|
# 检查必要文件是否存在
|
|
if [[ ! -f "$NODE_BIN" ]]; then
|
|
echo "错误: ARM64 Node.js 二进制文件未找到: $NODE_BIN"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "$NPM_CLI" ]]; then
|
|
echo "错误: ARM64 npm CLI 文件未找到: $NPM_CLI"
|
|
exit 1
|
|
fi
|
|
|
|
# 检查 qemu-aarch64-static 是否可用
|
|
if ! command -v qemu-aarch64-static &> /dev/null; then
|
|
echo "错误: qemu-aarch64-static 未找到,请先安装 qemu-user-static"
|
|
echo "安装命令: sudo apt-get install qemu-user-static"
|
|
exit 1
|
|
fi
|
|
|
|
# 执行 ARM64 npm 命令
|
|
qemu-aarch64-static -L /usr/aarch64-linux-gnu \
|
|
"$NODE_BIN" "$NPM_CLI" "$@"
|