@gbits-jszx/dg-cli 0.0.18 → 0.0.21
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/bin/dg-cli.js +22 -3
- package/package.json +6 -6
package/bin/dg-cli.js
CHANGED
|
@@ -14,9 +14,28 @@ let binPath;
|
|
|
14
14
|
try {
|
|
15
15
|
binPath = require.resolve(`${pkg}/bin/${exe}`);
|
|
16
16
|
} catch (e) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
// optionalDependencies 在装包时遇到任何瞬时错误(网络/权限/registry 镜像不同步)都会被
|
|
18
|
+
// npm 静默跳过、只记 lock,于是这里 require.resolve 找不到。绝大多数情况是缓存或安装
|
|
19
|
+
// 失败而不是平台真的不支持,按"清缓存 → 强装子包"的顺序给可执行排障步骤。
|
|
20
|
+
const supported = new Set([
|
|
21
|
+
"linux-x64", "linux-arm64",
|
|
22
|
+
"darwin-x64", "darwin-arm64",
|
|
23
|
+
"win32-x64",
|
|
24
|
+
]);
|
|
25
|
+
const tag = `${platform}-${arch}`;
|
|
26
|
+
console.error(`[dg-cli] 未能解析平台子包:${pkg}`);
|
|
27
|
+
if (!supported.has(tag)) {
|
|
28
|
+
console.error(`[dg-cli] 当前平台 ${tag} 不在支持矩阵内,请联系维护者补齐。`);
|
|
29
|
+
process.exit(2);
|
|
30
|
+
}
|
|
31
|
+
console.error(`[dg-cli] 平台 ${tag} 在支持矩阵内,子包很可能因 npm optionalDependencies 静默跳过未装到。`);
|
|
32
|
+
console.error(`[dg-cli] 排障步骤(依次尝试,命中即止):`);
|
|
33
|
+
console.error(` 1) 清缓存重试:`);
|
|
34
|
+
console.error(` rm -rf ~/.npm/_npx ~/.npm/_cacache && npx -y --prefer-online @gbits-jszx/dg-cli@latest --version`);
|
|
35
|
+
console.error(` 2) 强装当前平台子包:`);
|
|
36
|
+
console.error(` npm i -g @gbits-jszx/dg-cli ${pkg}`);
|
|
37
|
+
console.error(` 3) 内网镜像 registry 同步滞后?换 npmjs 试一次:`);
|
|
38
|
+
console.error(` npm --registry=https://registry.npmjs.org/ i -g @gbits-jszx/dg-cli ${pkg}`);
|
|
20
39
|
process.exit(2);
|
|
21
40
|
}
|
|
22
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gbits-jszx/dg-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "DataGateway CLI — 部署/运维/配置一站式(Go binary,npx 分发)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dg-cli": "bin/dg-cli.js"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"node": ">=14"
|
|
14
14
|
},
|
|
15
15
|
"optionalDependencies": {
|
|
16
|
-
"@gbits-jszx/dg-cli-linux-x64": "0.0.
|
|
17
|
-
"@gbits-jszx/dg-cli-linux-arm64": "0.0.
|
|
18
|
-
"@gbits-jszx/dg-cli-darwin-x64": "0.0.
|
|
19
|
-
"@gbits-jszx/dg-cli-darwin-arm64": "0.0.
|
|
20
|
-
"@gbits-jszx/dg-cli-win32-x64": "0.0.
|
|
16
|
+
"@gbits-jszx/dg-cli-linux-x64": "0.0.21",
|
|
17
|
+
"@gbits-jszx/dg-cli-linux-arm64": "0.0.21",
|
|
18
|
+
"@gbits-jszx/dg-cli-darwin-x64": "0.0.21",
|
|
19
|
+
"@gbits-jszx/dg-cli-darwin-arm64": "0.0.21",
|
|
20
|
+
"@gbits-jszx/dg-cli-win32-x64": "0.0.21"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"repository": {
|