create-openclaw-bot 5.1.11 → 5.1.13
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/CHANGELOG.md +122 -109
- package/CHANGELOG.vi.md +120 -109
- package/README.md +2 -2
- package/README.vi.md +2 -2
- package/cli.js +13 -5
- package/package.json +1 -1
- package/setup.js +279 -142
- package/style.css +1 -1
package/cli.js
CHANGED
|
@@ -275,11 +275,15 @@ function ensureUserWritableGlobalNpm({ isVi, osChoice }) {
|
|
|
275
275
|
process.env.npm_config_prefix = npmInfo.prefixDir;
|
|
276
276
|
ensureBinDirOnPath(npmInfo.binDir);
|
|
277
277
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
});
|
|
278
|
+
// On macOS (darwin), skip mutating global .npmrc prefix — conflicts with Homebrew.
|
|
279
|
+
// The npm_config_prefix env var set above is sufficient for this process.
|
|
280
|
+
if (process.platform !== 'darwin') {
|
|
281
|
+
execSync(`npm config set prefix "${npmInfo.prefixDir.replace(/"/g, '\\"')}"`, {
|
|
283
282
|
|
|
283
|
+
stdio: 'ignore',
|
|
284
284
|
|
|
285
|
+
shell: true,
|
|
285
286
|
|
|
287
|
+
env: process.env
|
|
286
288
|
|
|
289
|
+
});
|
|
290
|
+
}
|
|
287
291
|
|
|
288
292
|
appendLineIfMissing(path.join(os.homedir(), '.profile'), 'export PATH="$HOME/.local/bin:$PATH"');
|
|
289
293
|
appendLineIfMissing(
|
|
@@ -312,6 +316,10 @@ function installGlobalPackage(pkg, { isVi, osChoice, displayName }) {
|
|
|
312
316
|
if (npmInfo) {
|
|
313
317
|
installCommands.push(`npm install -g --prefix "${npmInfo.prefixDir.replace(/"/g, '\\"')}" ${pkg}`);
|
|
314
318
|
}
|
|
319
|
+
// macOS: if user-writable npm install fails, try sudo as last resort
|
|
320
|
+
if (osChoice === 'macos' || process.platform === 'darwin') {
|
|
321
|
+
installCommands.push(`sudo npm install -g ${pkg}`);
|
|
322
|
+
}
|
|
315
323
|
}
|
|
316
324
|
|
|
317
325
|
for (const cmd of installCommands) {
|