@auroraflow/code 0.0.17 → 0.0.19
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
CHANGED
|
@@ -93,6 +93,7 @@ export async function installOfficialClient(client) {
|
|
|
93
93
|
if (!spec) throw new Error(`unknown official client: ${client}`);
|
|
94
94
|
const npm = npmCommandSpec();
|
|
95
95
|
const args = ["install", "-g", `${spec.packageName}@latest`];
|
|
96
|
+
console.error(`[aurora] installing ${spec.name}: ${npm.command} ${[...npm.args, ...args].join(" ")}`);
|
|
96
97
|
await spawnAndWait(npm.command, [...npm.args, ...args], { ...process.env });
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -272,7 +273,15 @@ function npmCommandSpec() {
|
|
|
272
273
|
if (npmExecPath.endsWith(".js")) {
|
|
273
274
|
return { command: process.execPath, args: [npmExecPath] };
|
|
274
275
|
}
|
|
275
|
-
return { command: npmExecPath
|
|
276
|
+
if (npmExecPath) return { command: npmExecPath, args: [] };
|
|
277
|
+
if (process.platform === "win32") {
|
|
278
|
+
return { command: process.env.ComSpec || "cmd.exe", args: ["/d", "/c", "npm"] };
|
|
279
|
+
}
|
|
280
|
+
const npmBin = findPathCommand("npm");
|
|
281
|
+
if (!npmBin) {
|
|
282
|
+
throw new Error("npm command was not found in PATH. Install Node.js/npm or add npm to PATH, then retry.");
|
|
283
|
+
}
|
|
284
|
+
return { command: npmBin, args: [] };
|
|
276
285
|
}
|
|
277
286
|
|
|
278
287
|
function windowsCommandSpec(command, args) {
|