@srcroot/ui 0.0.16 → 0.0.17
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/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -582,10 +582,12 @@ async function init(options) {
|
|
|
582
582
|
async function installOneByOne(spinner2, packageManager2, installCmd2, missing2, cwd2, execSync) {
|
|
583
583
|
spinner2.warn("Batch installation failed. Attempting to install dependencies one by one...");
|
|
584
584
|
let allSucceeded = true;
|
|
585
|
+
const installFlags = packageManager2 === "npm" ? "--legacy-peer-deps" : "";
|
|
585
586
|
for (const dep of missing2) {
|
|
586
|
-
spinner2.start(`Installing ${chalk.cyan(dep)} via ${packageManager2}...`);
|
|
587
|
+
spinner2.start(`Installing ${chalk.cyan(dep)} via ${packageManager2}${installFlags ? " (with --legacy-peer-deps)" : ""}...`);
|
|
587
588
|
try {
|
|
588
|
-
|
|
589
|
+
const command = installFlags ? `${packageManager2} ${installCmd2} ${installFlags} ${dep}` : `${packageManager2} ${installCmd2} ${dep}`;
|
|
590
|
+
execSync(command, {
|
|
589
591
|
stdio: "pipe",
|
|
590
592
|
cwd: cwd2
|
|
591
593
|
});
|
|
@@ -609,8 +611,9 @@ async function init(options) {
|
|
|
609
611
|
console.log(chalk.green("\n\u2705 All dependencies installed successfully!\n"));
|
|
610
612
|
} else {
|
|
611
613
|
console.log(chalk.yellow("\n\u26A0 Some dependencies failed to install."));
|
|
614
|
+
const manualCmd = installFlags ? `${packageManager2} ${installCmd2} ${installFlags} ${missing2.join(" ")}` : `${packageManager2} ${installCmd2} ${missing2.join(" ")}`;
|
|
612
615
|
console.log(chalk.dim(`
|
|
613
|
-
Please manually run: ${
|
|
616
|
+
Please manually run: ${manualCmd}
|
|
614
617
|
`));
|
|
615
618
|
}
|
|
616
619
|
}
|