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