🐛 update pnpm install
This commit is contained in:
8
bin/builders/BaseBuilder.ts
vendored
8
bin/builders/BaseBuilder.ts
vendored
@@ -105,7 +105,9 @@ export default abstract class BaseBuilder {
|
|||||||
const registryOption = isChina
|
const registryOption = isChina
|
||||||
? ' --registry=https://registry.npmmirror.com'
|
? ' --registry=https://registry.npmmirror.com'
|
||||||
: '';
|
: '';
|
||||||
const legacyPeerDeps = ' --legacy-peer-deps'; // 解决dependency conflicts
|
// 根据包管理器类型设置依赖冲突解决选项
|
||||||
|
const peerDepsOption =
|
||||||
|
packageManager === 'npm' ? ' --legacy-peer-deps' : '';
|
||||||
|
|
||||||
const timeout = this.getInstallTimeout();
|
const timeout = this.getInstallTimeout();
|
||||||
|
|
||||||
@@ -118,13 +120,13 @@ export default abstract class BaseBuilder {
|
|||||||
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
||||||
await fsExtra.copy(projectCnConf, projectConf);
|
await fsExtra.copy(projectCnConf, projectConf);
|
||||||
await shellExec(
|
await shellExec(
|
||||||
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${legacyPeerDeps} --silent`,
|
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption} --silent`,
|
||||||
timeout,
|
timeout,
|
||||||
buildEnv,
|
buildEnv,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await shellExec(
|
await shellExec(
|
||||||
`cd "${npmDirectory}" && ${packageManager} install${legacyPeerDeps} --silent`,
|
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption} --silent`,
|
||||||
timeout,
|
timeout,
|
||||||
buildEnv,
|
buildEnv,
|
||||||
);
|
);
|
||||||
|
|||||||
7
dist/cli.js
vendored
7
dist/cli.js
vendored
@@ -659,17 +659,18 @@ class BaseBuilder {
|
|||||||
const registryOption = isChina
|
const registryOption = isChina
|
||||||
? ' --registry=https://registry.npmmirror.com'
|
? ' --registry=https://registry.npmmirror.com'
|
||||||
: '';
|
: '';
|
||||||
const legacyPeerDeps = ' --legacy-peer-deps'; // 解决dependency conflicts
|
// 根据包管理器类型设置依赖冲突解决选项
|
||||||
|
const peerDepsOption = packageManager === 'npm' ? ' --legacy-peer-deps' : '';
|
||||||
const timeout = this.getInstallTimeout();
|
const timeout = this.getInstallTimeout();
|
||||||
const buildEnv = this.getBuildEnvironment();
|
const buildEnv = this.getBuildEnvironment();
|
||||||
if (isChina) {
|
if (isChina) {
|
||||||
logger.info(`✺ Located in China, using ${packageManager}/rsProxy CN mirror.`);
|
logger.info(`✺ Located in China, using ${packageManager}/rsProxy CN mirror.`);
|
||||||
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
const projectCnConf = path.join(tauriSrcPath, 'rust_proxy.toml');
|
||||||
await fsExtra.copy(projectCnConf, projectConf);
|
await fsExtra.copy(projectCnConf, projectConf);
|
||||||
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${registryOption}${legacyPeerDeps} --silent`, timeout, buildEnv);
|
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption} --silent`, timeout, buildEnv);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${legacyPeerDeps} --silent`, timeout, buildEnv);
|
await shellExec(`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption} --silent`, timeout, buildEnv);
|
||||||
}
|
}
|
||||||
spinner.succeed(chalk.green('Package installed!'));
|
spinner.succeed(chalk.green('Package installed!'));
|
||||||
if (!tauriTargetPathExists) {
|
if (!tauriTargetPathExists) {
|
||||||
|
|||||||
Reference in New Issue
Block a user