fix: pin yarn registry and package manager
This commit is contained in:
parent
bf071a2679
commit
b7dafdd508
@ -4,7 +4,7 @@ enableGlobalCache: false
|
|||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
npmRegistryServer: "https://registry.npmmirror.com"
|
npmRegistryServer: "https://registry.npmjs.org"
|
||||||
|
|
||||||
packageExtensions:
|
packageExtensions:
|
||||||
"next-contentlayer@*":
|
"next-contentlayer@*":
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -49,7 +49,6 @@ init:
|
|||||||
echo "❌ Unsupported OS. Please install Yarn manually."; exit 1; \
|
echo "❌ Unsupported OS. Please install Yarn manually."; exit 1; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
yarn config set npmRegistryServer https://registry.npmmirror.com
|
|
||||||
yarn install --immutable
|
yarn install --immutable
|
||||||
|
|
||||||
ensure-deps:
|
ensure-deps:
|
||||||
@ -83,7 +82,6 @@ test:
|
|||||||
@yarn test || echo "No tests configured"
|
@yarn test || echo "No tests configured"
|
||||||
|
|
||||||
build: init
|
build: init
|
||||||
yarn config set npmRegistryServer https://registry.npmmirror.com
|
|
||||||
@if [ -z "$(SKIP_SYNC)" ]; then \
|
@if [ -z "$(SKIP_SYNC)" ]; then \
|
||||||
$(MAKE) sync-dl-index; \
|
$(MAKE) sync-dl-index; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
13
start.sh
13
start.sh
@ -8,12 +8,13 @@ cd /var/www/XControl/dashboard
|
|||||||
# 2. 安装 Node.js 和 npm
|
# 2. 安装 Node.js 和 npm
|
||||||
sudo apt install -y nodejs
|
sudo apt install -y nodejs
|
||||||
|
|
||||||
# 安装生产依赖(跳过 devDependencies)
|
# 使用仓库声明的 Yarn 版本和 npm 官方 registry,避免落到全局 Yarn Classic 或 yarnpkg proxy。
|
||||||
npm install --omit=dev --registry=https://registry.npmmirror.com
|
corepack enable
|
||||||
npm install -g yarn --registry=https://registry.npmmirror.com
|
corepack prepare yarn@4.12.0 --activate
|
||||||
|
yarn install --immutable
|
||||||
|
|
||||||
# 构建项目
|
# 构建项目
|
||||||
/usr/bin/npm run build --registry=https://registry.npmmirror.com
|
yarn build
|
||||||
|
|
||||||
# 启动 Next.js 生产服务器
|
# 启动 Next.js 生产服务器
|
||||||
/usr/bin/npm start
|
yarn start
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user