Skip to content

Commit 7f2c994

Browse files
committed
fix(ng-dev): fix release issues with PNPM
Currently the release process hangs due to PNPM being interactive `The modules directories will be removed and reinstalled from scratch. Proceed? (Y/n) ` if when pressing `yes` the process does not continue. Also, there is no reason why using `npx` to invoke `pnpm` as when having pnpm version 10 locally the correct version of pnpm will be downloaded.
1 parent 368d4b7 commit 7f2c994

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

ng-dev/release/publish/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ export abstract class ReleaseAction {
390390
/** Installs all Yarn dependencies in the current branch. */
391391
protected async installDependenciesForCurrentBranch() {
392392
if (await this.pnpmVersioning.isUsingPnpm(this.projectDir)) {
393-
await ExternalCommands.invokePnpmInstall(this.projectDir, this.pnpmVersioning);
393+
await ExternalCommands.invokePnpmInstall(this.projectDir);
394394
return;
395395
}
396396

ng-dev/release/publish/external-commands.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,21 @@ export abstract class ExternalCommands {
239239
* Invokes the `pnpm install` command in order to install dependencies for
240240
* the configured project with the currently checked out revision.
241241
*/
242-
static async invokePnpmInstall(
243-
projectDir: string,
244-
pnpmVersioning: PnpmVersioning,
245-
): Promise<void> {
242+
static async invokePnpmInstall(projectDir: string): Promise<void> {
246243
try {
247-
const pnpmSpec = await pnpmVersioning.getPackageSpec(projectDir);
248-
await ChildProcess.spawn('npx', ['--yes', pnpmSpec, 'install', '--frozen-lockfile'], {
249-
cwd: projectDir,
250-
});
244+
await ChildProcess.spawn(
245+
'pnpm',
246+
[
247+
'install',
248+
'--frozen-lockfile',
249+
// PNPM does not have no interactive,
250+
// See: https://github.com/pnpm/pnpm/issues/6778
251+
'--config.confirmModulesPurge=false',
252+
],
253+
{
254+
cwd: projectDir,
255+
},
256+
);
251257

252258
Log.info(green(' ✓ Installed project dependencies.'));
253259
} catch (e) {

0 commit comments

Comments
 (0)