fix: include package-lock.json in npm package, use npm ci for consistent deps (v1.1.1)

This commit is contained in:
陈海富
2026-01-31 20:14:56 +08:00
parent 019762b911
commit 577c34eab9
2 changed files with 16 additions and 5 deletions

View File

@@ -39,10 +39,20 @@ function ensureDependencies() {
const npmCmd = isWindows ? 'npm.cmd' : 'npm';
try {
execSync(npmCmd + ' install', {
cwd: packageRoot,
stdio: 'inherit'
});
// 优先使用 npm ci使用 package-lock.json 保证版本一致)
// 如果 npm ci 失败则回退到 npm install
try {
execSync(npmCmd + ' ci', {
cwd: packageRoot,
stdio: 'inherit'
});
} catch (ciErr) {
console.log('\nnpm ci 失败,尝试 npm install...\n');
execSync(npmCmd + ' install', {
cwd: packageRoot,
stdio: 'inherit'
});
}
console.log('\n✅ 依赖安装完成!\n');
} catch (err) {
console.error('\n❌ 依赖安装失败,请手动运行: npm install');

View File

@@ -1,6 +1,6 @@
{
"name": "cfspider-browser",
"version": "1.1.0",
"version": "1.1.1",
"description": "CFspider 智能浏览器 - AI驱动的浏览器自然语言控制浏览器自动化",
"keywords": [
"browser",
@@ -43,6 +43,7 @@
"tailwind.config.js",
"postcss.config.js",
"electron-builder.json",
"package-lock.json",
"README.md"
],
"scripts": {