mirror of
https://github.com/violettoolssite/CFspider.git
synced 2026-04-05 03:09:01 +08:00
fix: include package-lock.json in npm package, use npm ci for consistent deps (v1.1.1)
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user