fe-build-cli 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/update.js +6 -1
package/package.json
CHANGED
package/src/update.js
CHANGED
|
@@ -39,7 +39,12 @@ export function getCurrentVersion() {
|
|
|
39
39
|
*/
|
|
40
40
|
export async function getLatestVersion() {
|
|
41
41
|
try {
|
|
42
|
-
|
|
42
|
+
// 使用 --silent 参数避免显示 npm 警告
|
|
43
|
+
const result = execSync('npm view fe-build-cli version --silent 2>nul', {
|
|
44
|
+
encoding: 'utf-8',
|
|
45
|
+
timeout: 10000,
|
|
46
|
+
stdio: ['pipe', 'pipe', 'pipe'] // 隐藏 stderr
|
|
47
|
+
});
|
|
43
48
|
return result.trim();
|
|
44
49
|
} catch (error) {
|
|
45
50
|
throw new Error('无法获取最新版本,请检查网络连接或 npm 源');
|