weloop-kosign 1.0.5 → 1.0.6
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 +1 -1
- package/scripts/cli-remote.js +46 -1
package/package.json
CHANGED
package/scripts/cli-remote.js
CHANGED
|
@@ -151,7 +151,52 @@ async function installPackages(packages) {
|
|
|
151
151
|
|
|
152
152
|
try {
|
|
153
153
|
const installCmd = getInstallCommand(packageManager, packages);
|
|
154
|
-
|
|
154
|
+
|
|
155
|
+
// Filter out ERESOLVE peer dependency warnings while keeping errors
|
|
156
|
+
if (packageManager === 'npm') {
|
|
157
|
+
const { spawn } = require('child_process');
|
|
158
|
+
const [cmd, ...args] = installCmd.split(' ');
|
|
159
|
+
|
|
160
|
+
await new Promise((resolve, reject) => {
|
|
161
|
+
const proc = spawn(cmd, args, {
|
|
162
|
+
cwd: process.cwd(),
|
|
163
|
+
stdio: ['inherit', 'inherit', 'pipe'],
|
|
164
|
+
shell: true
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
let stderr = '';
|
|
168
|
+
proc.stderr.on('data', (data) => {
|
|
169
|
+
const output = data.toString();
|
|
170
|
+
// Filter out ERESOLVE warnings but keep actual errors
|
|
171
|
+
if (!output.includes('ERESOLVE overriding peer dependency') &&
|
|
172
|
+
!output.includes('npm warn ERESOLVE')) {
|
|
173
|
+
process.stderr.write(data);
|
|
174
|
+
}
|
|
175
|
+
stderr += output;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
proc.on('close', (code) => {
|
|
179
|
+
if (code !== 0) {
|
|
180
|
+
// Check if it's a real error (not just warnings)
|
|
181
|
+
const hasRealError = stderr.includes('npm error') &&
|
|
182
|
+
!stderr.match(/npm error.*ERESOLVE/);
|
|
183
|
+
if (hasRealError) {
|
|
184
|
+
reject(new Error(`Installation failed with code ${code}`));
|
|
185
|
+
} else {
|
|
186
|
+
// Installation succeeded despite warnings
|
|
187
|
+
resolve();
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
resolve();
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
proc.on('error', reject);
|
|
195
|
+
});
|
|
196
|
+
} else {
|
|
197
|
+
execSync(installCmd, { stdio: 'inherit', cwd: process.cwd() });
|
|
198
|
+
}
|
|
199
|
+
|
|
155
200
|
success(`Dependencies installed successfully`);
|
|
156
201
|
} catch (error) {
|
|
157
202
|
warn(`Failed to install dependencies automatically`);
|