The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 10:45 UTC
fix(grok): Grok updates actually install on npm 12 (#24246)
Ishaan Kothari committed
Oct 31, 2026 at 01:30 UTC
3e2dff42066404c4f421101f8397a95ca955a07d
2 files changed
+4
-1
packages/provider-grok/src/server/driver.test.ts
+2
@@ -117,6 +117,8 @@ it.layer(layerTest)("GrokDriver", (it) => {
117
executable: binaryPath,
118
args: ["update"],
119
lockKey: "grok",
120
+ // npm 12 otherwise skips the postinstall that installs the new binary.
121
+ env: expect.objectContaining({ npm_config_allow_scripts: "@xai-official/grok" }),
122
}),
123
},
124
] as const;
packages/provider-grok/src/server/driver.ts
+2
-1
@@ -50,6 +50,7 @@ const DRIVER_KIND = ProviderDriverKind.make("grok");
50
// npm latest matches the stable channel installed by grok update.
51
const GROK_NPM_PACKAGE = "@xai-official/grok";
52
// `grok update` installs under `GROK_HOME`; use the resolved executable and instance environment.
53
+// npm 12 blocks the postinstall that moves the new binary in, yet exits 0, so allow it by env.
54
// Homebrew casks need brew upgrades; `grok update` would install a second copy.
55
// Keep casks manual when their brew cannot vouch for them.
56
const UPDATE: ProviderMaintenanceCapabilitiesResolver = {
@@ -83,7 +84,7 @@ const UPDATE: ProviderMaintenanceCapabilitiesResolver = {
84
updateArgs: ["update"],
85
updateLockKey: "grok",
86
platform: context.platform,
86
- env: context.env,
87
+ env: { ...context.env, npm_config_allow_scripts: GROK_NPM_PACKAGE },
88
});
89
}),
90
};